---
updatedAt: 2026-09-08T20:26:09.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# Generate an API token

Given an email address and a password, generate an API authorization token.
This token can be used with Bearer authorization when used together with
the customer ID. (The customer ID is the same as the first number in the API
server URL.)

```
Authorization: Bearer <customerid> <apitoken>
```

Only "local" users that have a password can use this API; SSO users cannot
log in using a password.

This endpoint does not itself need to Authorization header.


# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Observe by Snowflake API",
    "description": "# Overview\nWelcome to the Observe API Docs!\n\nThe Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded.\n\n## Authentication\nRequests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication:\n```\n// passing token as bearer token\ncurl -H \"Authorization: Bearer <customerid> <token>\" https://<customerid>.<observe-domain>.com/v1/...\n```\n",
    "version": "1.0.230307"
  },
  "servers": [
    {
      "url": "https://{customerid}.observeinc.com",
      "description": "US west server",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        }
      }
    },
    {
      "url": "https://{customerid}.{cluster}.observeinc.com",
      "description": "Specific regional cluster (prod)",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        },
        "cluster": {
          "enum": [
            "eu-1",
            "ap-1"
          ],
          "default": "eu-1",
          "description": "For regional clusters, choose one."
        }
      }
    },
    {
      "url": "https://{customerid}.{domain}.com",
      "description": "Specific Observe server",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        },
        "domain": {
          "default": "OBSERVE_DOMAIN",
          "description": "The Observe domain for your instance."
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Login",
      "description": "Manage api tokens. Learn more about [api tokens](https://docs.observeinc.com/en/latest/content/reference/ObserveAPIAuth.html).\n"
    }
  ],
  "paths": {
    "/v1/login": {
      "post": {
        "summary": "Generate an API token",
        "operationId": "generateAPIToken",
        "tags": [
          "Login"
        ],
        "description": "Given an email address and a password, generate an API authorization token.\nThis token can be used with Bearer authorization when used together with\nthe customer ID. (The customer ID is the same as the first number in the API\nserver URL.)\n\n```\nAuthorization: Bearer <customerid> <apitoken>\n```\n\nOnly \"local\" users that have a password can use this API; SSO users cannot\nlog in using a password.\n\nThis endpoint does not itself need to Authorization header.\n",
        "security": [],
        "requestBody": {
          "description": "The login username and password.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_email",
                  "user_password"
                ],
                "properties": {
                  "user_email": {
                    "description": "The email address of the user to mint credentials for.",
                    "type": "string"
                  },
                  "user_password": {
                    "description": "The password of the user minting credentials.",
                    "type": "string",
                    "format": "password"
                  },
                  "tokenName": {
                    "description": "Optional name of the token, to remember what it is for.",
                    "type": "string"
                  }
                }
              },
              "example": {
                "user_email": "user@example.com",
                "user_password": "hunter1",
                "tokenName": "for the coin tracker integration"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "## Description of result data formats\n\n### Content-type: application/json\nThe response contains an 'ok' field (boolean) and an \"access_key\"\nfield (string).  The \"access_key\" is a secret value and is as good\nas the password for accessing the customer instance, so treat it\nwith care. You must remember it, because it is not stored and\ncannot be retrieved again, although another access key can be\ngenerated through another invocation of the API.  By default,\naccess keys that are not used, are invalidated after about 10 days\nof inactivity.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": "{\"ok\":true,\"access_key\":\"ZrL5BhtFXvu2Xe78GznP1dP2Ts81ZszA\"}\n"
              }
            }
          },
          "400": {
            "description": "Invalid request."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Authorization: Bearer <customerid> <apitoken>\n"
      }
    }
  }
}
````