Skip to content

Create a personal token

Before you begin

Role
Viewer or higher to create and revoke your own tokens and Admin or higher to revoke another member's token.

A personal token lets a program, such as an AI assistant or a script on your computer, act as you in one workspace, with the role you give it there, never more than your own. Roles, personal tokens and machine tokens explains when a machine token suits better.

  1. In the workspace switcher, which shows the workspace’s name in the page header, choose the workspace the token is for. The token works only in that workspace and is listed there.

  2. Open Settings → Tokens. Settings is in the account menu, which shows your name in the page header. On a plan without machine tokens the Tokens tab carries a plan tag, but personal tokens work on every plan.

  3. Under API tokens, select New API token.

  4. Enter a Name that says where the token will be used, such as Claude Code - work laptop.

  5. Choose its Role: Viewer, Editor or Admin, up to your own role in the workspace. The form starts at Editor, or at your role when that is lower. Choose Viewer for an AI assistant that only reads projects, mocks and request logs.

  6. Choose when it Expires after, from 7 days to 1 year. The form starts at 90 days and shows the date the token will stop working.

  7. Select Create API token.

  8. Select Copy, and store the token where the program will read it, such as an environment variable or your CI’s secret store. It starts with mh_sk_ and is shown only this once.

  9. Select I have stored it.

The token is listed under API tokens with its Name, its Role, the characters it Starts with, such as mh_sk_3f9a1c, Never used under Last used, and the date it Expires. In the last week before that date the row says so, for example Expires in 3 days, then Expires within a day, and afterwards Expired.

A program sends the token in the Authorization header of each request:

Authorization: Bearer mh_sk_…

To use it with an AI assistant, continue with Connect an AI assistant.

  1. Open Settings → Tokens.

  2. To see other members’ tokens as an Admin, select Everyone’s instead of Yours. The Acts as column then shows whose each token is.

  3. In the token’s row, select the revoke button, named Revoke followed by the token’s name.

  4. Select Revoke token to confirm.

The token stops working at once: anything still using it gets 401. A revoked token cannot be restored.

  • A token cannot be extended. Before it expires, create another one and replace it wherever the old one is used.
  • MockHub keeps only a fingerprint of the token, so a lost token cannot be shown again. Revoke it and create another.
  • The token’s role is never above yours. If an Admin lowers your role, the token is lowered with it; if they raise it, the token keeps the role it was created with. A token’s role cannot be changed: create another token instead.
  • The token works only in the workspace it was created in, even where you are a member of others.
  • The token cannot change your account: your profile, email address or password, sign-in methods, invitations, new workspaces or new tokens all need you signed in to MockHub. It can still revoke itself.
  • For a program that must stay within one project, an Admin can create a machine token.
  • The list shows the tokens of the selected workspace only. A token created in one workspace is not listed in another.
  • An expired token stays in the list until you revoke it.
  • Each token can make 600 calls a minute to MockHub, counted apart from your own calls in the app and from every other token. AI assistants are counted separately; see MCP tools. Further calls are answered with 429 and a Retry-After header giving the seconds until the minute is over.
  • If your MockHub address was never verified, the first sign-in with GitHub or Google for that address deletes every token you created, machine tokens included, because MockHub takes it as proof the account is yours and cancels the credentials made before. Later sign-ins, and any sign-in to an account whose address is verified, delete nothing. See Manage sign-in methods and sessions.

Report a problem with this page