---
id: access-token-create
title: "Create or renew your access tokens"
description: "Create or renew your access token."
sidebar_label: "Create or renew your access tokens"
hide_title: true
hide_table_of_contents: true
api: eJzdWFFv4zYS/isDPrWGVvHuJteegCvOGyzQ3MM1t82iPSSBPRbHFjcUqSWpJK7h/14MJdmS49s4PbRXnB8ESxqRM9/3zXDItZDkc6eqoKwRmTh3hIHAOnBk6AFWtnaAeU7eQ7B3ZNIbc2OyLFNmYeHGwMWCbcAQSSitI4gvrGmsfQJ5Qfkd8DDXtScHy1pJ8rdfnUib+xOsQ2Gd+gV5/hOs1Ks7Wvmv0zjHjRGJCLj0IrsWkzoUZILKo6m4TYStyMWbCyky0Tg5jdNmeQxDJMLR55p8eGflSmTrvWCvCoLWAOZWrmBhHZAKBTmIIyiz3ELB//tA+BQYiu/gvLDWU/fdaNRCiMD4RdPRiEcZjT7sIO2eBwueCELriXIkoUKHJQVyPo0I5NYEMoH9x6rSLQInnzwHsRY+L6hE/mcN/bAQ2fVaBBU07ejs+cKIrip+Z+efKA8i2QPl0tl7JbfxoIEZVmp6R6sZjEbWsdMFQXDKwowZNVjSLIFZhd4/WCdnCaCRMLNuiaZldqrkLL0x7x8xD3oF1hDYOCGUNYNP4GsOjWQTci+SPWe7yD56JmRyeQF3tGqJZvRYKq2/rJHKsUqCIt/A17zItuP64JRZPgGBldGODbUnyTzZeUBlGvpGI0MPoxHM+qqbRf0wOAvlfICgSmrCoUcsq+j2ZDKZpK/fvD09+8s33/51jPNc0mL//vLK/01sNolAKRV7hPqyF8cCtadN8hw2HTeRjY6cPaQ6G5GInsUec09x3H72LJD/ZrS2njA+OMjjtMmhC5PrWhKoAB3EXWIGC6NRk8+jUfNqiPo+xKjpMZWW/k4lKp3mthSbXngHXF5YV2IQWR+DA2F0b/+YMNhkunVo85SVo0RcG/W5JlCSfV0octH5OH1/vN/Bfxb1syK+jTJuZbtfHg+Uqr52HS0c+WLa2T6r2uEHR8EXTdvMJwmyZsuY4sqooFDv6QDqmHoxhrZ+HAltX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NY+cNFK+ueNqk69WfFkbe1bYc5zlV4Yu2tz0BXv7w45VIxLw9rixj8REOH7ig4oPIBLfVkZpmS8vP1kKjWdYxs0QzJv9+BSLkncI=
sidebar_class_name: "post api-method"
info_path: docs/api/authentication
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create or renew your access tokens"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/token"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Create or renew your access token.

:::info 
 If you need more info on tokens, check our [user guides](/docs/authorization/api-keys).
:::


<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"description":"The request body for either creating or renewing access tokens. \n\n> Choose either **Create a new token** or **Renew your token** to see the required parameters.\n","content":{"application/json":{"schema":{"oneOf":[{"title":"Create a new token","type":"object","description":"Provide either an `api_key` **or** the trio `username`, `password`, and `organization_id`.\nExactly one option must be supplied.\n","oneOf":[{"type":"object","title":"Using API key","required":["api_key"],"properties":{"api_key":{"type":"string","description":"The API key used to obtain your **new** `access_token` for the first time.\n","example":"AAAA.1234567890abcdef1234567890abcdefPTs="}},"additionalProperties":false},{"type":"object","title":"Using username and password","required":["username","password","organization_id"],"properties":{"username":{"type":"string","description":"Your username for authentication.\n\n> Include it in your request to **create** your `access_token`.\n","example":"alex.doe@email.com"},"password":{"type":"string","format":"password","description":"Your password for authentication.\n\n> Include it in your request to **create** your `access_token`.\n","example":"your_password"},"organization_id":{"type":"string","description":"The unique identifier for your organization.\n\n> Include it in your request to **create** your `access_token`.\n","example":"1234"}},"additionalProperties":false}]},{"title":"Renew your token","type":"object","required":["refresh_token","organization_id"],"properties":{"refresh_token":{"type":"string","description":"The token obtained during the initial authentication using your API key.\n\n> Include it in your request to **renew** your `access_token`.\n","example":"abJjdHki..."},"organization_id":{"type":"string","description":"The unique identifier for your organization.\n\n> Include it in your request to **renew** your `access_token`.\n","example":"1234"}}}],"title":"AuthTokenRequest"},"examples":{"New token by API key":{"value":{"api_key":"AAAA.1234567890abcdef1234567890abcdefPTs="}},"New token by username and password":{"value":{"username":"alex.doe@email.com","password":"your_password","organization_id":"1234"}},"Renew token":{"value":{"refresh_token":"abJjdHki...","organization_id":"1234"}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The operation was successful.","content":{"application/json":{"schema":{"required":["access_token","organization_id"],"properties":{"access_token":{"type":"string","description":"The short-lived Bearer token that you need to pass on API calls.","example":"abJraWQi..."},"refresh_token":{"type":"string","description":"A long-lived token that you can use to renew access tokens.","example":"abJraWQi..."},"organization_id":{"type":"integer","description":"The unique identifier for your organization.","example":1234},"token_expires_at":{"type":"integer","description":"The timestamp when the access token expires, in milliseconds.","example":1700000000000}},"title":"AuthTokenResponse"}}}},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      