Saltar al contenido principal
Usa los endpoints de cuenta para listar cuentas, administrar roles, restablecer contraseñas y crear o revocar tokens de API. También puedes listar organizaciones vinculadas a una cuenta y unirte a una organización por ID.

Solicitud básica y respuesta

Lista las cuentas visibles para tu token con GET /api/v1/account.
curl "https://{BASE_URL}/api/v1/account" \
  -H "Authorization: Bearer {API_TOKEN}"
[
  {
    "id": "acct_6c8a1f3b2d4e5f7a",
    "email": "sasha@auroralabs.com",
    "name": "Sasha Patel",
    "given_name": "Sasha",
    "family_name": "Patel",
    "provider": "Credentials",
    "users": [
      {
        "id": "user_4b7c2a1d9e5f3c8b",
        "org_id": "org_2f3a9d1c7b5e4a8f",
        "account_id": "acct_6c8a1f3b2d4e5f7a",
        "name": "Sasha Patel",
        "email": "sasha@auroralabs.com",
        "state": "Active",
        "roles": ["AppAdmin"],
        "created_at": "2026-02-08T14:12:45Z"
      }
    ],
    "roles": ["AppAdmin"]
  }
]

Obtener una cuenta

curl "https://{BASE_URL}/api/v1/account/{accountID}" \
  -H "Authorization: Bearer {API_TOKEN}"
{
  "id": "acct_6c8a1f3b2d4e5f7a",
  "email": "sasha@auroralabs.com",
  "name": "Sasha Patel",
  "given_name": "Sasha",
  "family_name": "Patel",
  "provider": "Credentials",
  "users": [
    {
      "id": "user_4b7c2a1d9e5f3c8b",
      "org_id": "org_2f3a9d1c7b5e4a8f",
      "account_id": "acct_6c8a1f3b2d4e5f7a",
      "name": "Sasha Patel",
      "email": "sasha@auroralabs.com",
      "state": "Active",
      "roles": ["AppAdmin"],
      "created_at": "2026-02-08T14:12:45Z"
    }
  ],
  "roles": ["AppAdmin"]
}

Actualizar una cuenta

curl -X POST "https://{BASE_URL}/api/v1/account/{accountID}" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "id": "acct_6c8a1f3b2d4e5f7a",
  "state": "Active",
  "email": "sasha@auroralabs.com",
  "name": "Sasha Patel",
  "profile_picture": "https://{BASE_URL}/s3/public/{ACCOUNT_ID}/media/account_picture.png",
  "provider": "Credentials",
  "roles": ["AppAdmin"]
}

Actualizar tu contraseña

curl -X PUT "https://{BASE_URL}/api/v1/account/me" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "current_password": "{password}",
    "new_password": "{password}"
  }'
HTTP/1.1 204 No Content

Restablecer la contraseña de una cuenta

curl -X POST "https://{BASE_URL}/api/v1/account/{accountID}/reset-password" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "new_password": "{password}"
  }'
{
  "new_password": "Temp!Passw0rd2026"
}

Listar tokens de API

curl "https://{BASE_URL}/api/v1/account/token" \
  -H "Authorization: Bearer {API_TOKEN}"
[
  {
    "name": "ci-deploy",
    "token": "v1---redacted",
    "hashed_token": "sha256:2b7f...",
    "token_email": "sasha@auroralabs.com",
    "last_used_at": "2026-02-08T13:58:10Z",
    "created_at": "2026-02-01T09:12:00Z",
    "valid_until": "2026-08-01T00:00:00Z"
  }
]

Crear un token de API

curl -X POST "https://{BASE_URL}/api/v1/account/token" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ci-deploy",
    "revoke_existing": false,
    "valid_until": "2026-08-01T00:00:00Z"
  }'
{
  "name": "ci-deploy",
  "token": "v1---redacted",
  "hashed_token": "sha256:2b7f...",
  "token_email": "sasha@auroralabs.com",
  "last_used_at": null,
  "created_at": "2026-02-08T14:22:00Z",
  "valid_until": "2026-08-01T00:00:00Z"
}

Revocar un token de API

curl -X DELETE "https://{BASE_URL}/api/v1/account/token?token={tokenHash}" \
  -H "Authorization: Bearer {API_TOKEN}"
"ok"

Listar organizaciones de una cuenta

curl "https://{BASE_URL}/api/v1/account/organization" \
  -H "Authorization: Bearer {API_TOKEN}"
[
  {
    "name": "Aurora Labs",
    "context": "Enterprise R&D and analytics.",
    "email_regex": ".*@auroralabs.com"
  }
]

Unirse a una organización

curl -X POST "https://{BASE_URL}/api/v1/account/organization/{orgID}/join" \
  -H "Authorization: Bearer {API_TOKEN}"
{
  "id": "user_4b7c2a1d9e5f3c8b",
  "org_id": "org_2f3a9d1c7b5e4a8f",
  "account_id": "acct_6c8a1f3b2d4e5f7a",
  "name": "Sasha Patel",
  "email": "sasha@auroralabs.com",
  "state": "Active",
  "roles": ["AppMember"],
  "created_at": "2026-02-08T14:25:31Z"
}

Errores y casos límite

  • 401/403: token inválido o ausente.
  • 409: el nombre del token ya existe.
  • 404: cuenta u organización no encontrada.