Skip to main content

Claim Agent Account

POST/v2/agent/claim

Step 2 of creating a Mida account from an AI agent. Send the 6-digit code the person received by email. Mida creates the account and its first project, and returns an API key and the project key.

Body fields​

FieldTypeRequiredDescription
claim_tokenstringYesThe token returned by Register Agent Account
codestringYesThe 6 digits from the email

Call the same region you registered with.

Example​

curl -X POST "https://api-{region}.mida.so/v2/agent/claim" \
-H "Content-Type: application/json" \
-d '{"claim_token": "CLAIM_TOKEN_FROM_REGISTER", "code": "123456"}'

Success response​

{
"success": true,
"api_key": "mk-v1-…",
"api_key_note": "Shown once. Store it as a secret (an environment variable), never in source control.",
"project_key": "YOUR_PROJECT_KEY",
"region": "us",
"api_base": "https://api-us.mida.so/v2",
"auth_header": "Authorization: Bearer <api_key>",
"dashboard": {
"url": "https://us.mida.so",
"sign_in": "The account has no password yet. The person sets one at https://us.mida.so/forgot-password with this email."
},
"next_steps": ["…"]
}

Response fields​

FieldTypeDescription
api_keystringThe account's first API key. It is shown once; store it as a secret. The person can revoke it in the dashboard under Settings, API
project_keystringThe key of the account's first project. Use it in every /v2/project/{project_key}/… call and in the install tag
regionstringus or eu
api_basestringThe base URL for all further calls
dashboard.urlstringWhere the person signs in
dashboard.sign_instringHow the person sets a password. The account is created without one

What to do next​

  1. Get Install Health after adding the install tag to the site. The tag comes from GET /v2/project/{project_key}/install-snippet.
  2. Create Goal, then Create Experiment as a draft.
  3. Get Pre-Publish Check and fix what it reports.
  4. Ask the person before setting an experiment live. Launching changes what their visitors see.

Errors​

StatuscodeMeaning
400wrong_codeThe code is not right. The message says how many tries are left
400invalid_code, invalid_claimThe code is not 6 digits, or the token is malformed
403signup_refusedMida could not create an account for this address. The person can sign up at app.mida.so/sign-up
409account_existsThe address already has a Mida account
410claim_expiredThe claim expired, was used, had five wrong codes, or was never sent a code. Start again with Register Agent Account
429rate_limitedToo many attempts. Try again later