Authentication

Authentication is required to access protected resources in the Gatsby API. On this page, we'll explain how to authenticate with the API and retrieve your user information.

RECOMMENDEDx-api-key

API tokens

An API token is a long-lived credential tied to a single organization. Because the organization is bound to the token, you only need to send the x-api-key header — the organizationSlug header is not required.

API tokens must be enabled for your organization before you can create one. To request access, email help@gatsby.events and ask to have API tokens enabled for your organization.

Once enabled, a Super Admin or Admin can create a token from the Gatsby dashboard under Team Settings → Linked Services → API Keys. Copy it when it is first shown — for security, it is only displayed once. API tokens begin with gat_.

Required headers

  • Name
    x-api-key
    Type
    string
    Description

    Your organization's API token. Include it on every request.

Request

GET
/person
curl https://rest.gatsby.events/person \
  -H "x-api-key: {your-api-token}"

Access tokens (legacy)

To use the legacy access-token flow, you need to:

  1. Log in with your email and password to obtain an access token
  2. Include this token in all subsequent requests in the Authorization header
  3. Include your organization slug in the organizationSlug header

All requests (except for login) require both the access token and organization slug to be present in the headers.

Authorization: Bearer {accessToken}
organizationSlug: {organizationSlug}

POST/login

Login

This endpoint allows you to authenticate with the Gatsby API using your email and password. Upon successful authentication, you will receive an access token and a list of organization slugs that you have access to.

Required attributes

  • Name
    email
    Type
    string
    Description

    Your Gatsby account email address.

  • Name
    password
    Type
    string
    Description

    Your Gatsby account password.

Request

POST
/login
curl https://rest.gatsby.events/login \
  -d '{"email":"your-email@example.com","password":"your-password"}'

Response

{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "organizationSlugs": [
    "gatsby-labs",
    "acme-inc"
  ]
}

GET/me

Get current user

This endpoint allows you to retrieve information about the currently authenticated user. The response includes the user's name, email, role, and a list of organization slugs they have access to.

Request

GET
/me
curl https://rest.gatsby.events/me \
  -H "Authorization: Bearer {accessToken}"

Response

{
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "role": "admin",
  "organizationSlugs": [
    "gatsby-labs", 
    "acme-inc"
  ]
}

Was this page helpful?