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.
We recommend authenticating with an API token. The email and password login flow below still works, but it is no longer the recommended approach for new integrations.
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
curl https://rest.gatsby.events/person \
-H "x-api-key: {your-api-token}"
Access tokens (legacy)
This email and password flow still works, but we recommend authenticating with an API token instead.
To use the legacy access-token flow, you need to:
- Log in with your email and password to obtain an access token
- Include this token in all subsequent requests in the
Authorizationheader - Include your organization slug in the
organizationSlugheader
All requests (except for login) require both the access token and organization slug to be present in the headers.
Authorization: Bearer {accessToken}
organizationSlug: {organizationSlug}
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
curl https://rest.gatsby.events/login \
-d '{"email":"your-email@example.com","password":"your-password"}'
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"organizationSlugs": [
"gatsby-labs",
"acme-inc"
]
}
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
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"
]
}