> For the complete documentation index, see [llms.txt](https://help.aphex.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aphex.co/docs/integrations-and-api/apis/aphex-tasks-api/authentication.md).

# Authentication

To generate a session token, you must provide a valid Client ID and Client Secret.

While in closed beta, you can obtain your API keys by contacting our Customer Success team.

## Generate Token

Use this endpoint to generate a temporary Access Token

## generate token

> Generate token

```json
{"openapi":"3.1.1","info":{"title":"Plan API","version":"1.4.0"},"servers":[{"url":"https://app.aphex.co/"}],"paths":{"/{region}/v1/auth/token":{"post":{"description":"Generate token","parameters":[{"schema":{"type":"string","enum":["gb","au"]},"description":"gb | au","in":"path","name":"region","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.OAuth2Token"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}}},"summary":"generate token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.GenerateTokenPayload"}}},"description":"generator token payload","required":true}}}},"components":{"schemas":{"models.OAuth2Token":{"properties":{"accessToken":{"type":"string"},"expiresIn":{"type":"string"},"tokenType":{"type":"string"}},"type":"object"},"echo.HTTPError":{"properties":{"message":{}},"type":"object"},"handlers.GenerateTokenPayload":{"properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"}},"type":"object"}}}}
```

## Revoke Token

Use this endpoint to revoke a previously generated Access token

## revoke token

> Revoke token

```json
{"openapi":"3.1.1","info":{"title":"Plan API","version":"1.4.0"},"servers":[{"url":"https://app.aphex.co/"}],"paths":{"/{region}/v1/auth/token/revoke":{"post":{"description":"Revoke token","parameters":[{"schema":{"type":"string","enum":["gb","au"]},"description":"gb | au","in":"path","name":"region","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}}},"summary":"revoke token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RevokeTokenPayload"}}},"description":"revoke token payload","required":true}}}},"components":{"schemas":{"echo.HTTPError":{"properties":{"message":{}},"type":"object"},"handlers.RevokeTokenPayload":{"properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"},"token":{"type":"string"}},"type":"object"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aphex.co/docs/integrations-and-api/apis/aphex-tasks-api/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
