> 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.3.5"},"servers":[{"url":"https://app.aphex.co/"}],"paths":{"/{region}/v1/auth/token":{"post":{"description":"Generate token","summary":"generate token","parameters":[{"enum":["gb","au"],"type":"string","description":"gb | au","name":"region","in":"path","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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.GenerateTokenPayload"}}},"description":"generator token payload","required":true}}}},"components":{"schemas":{"models.OAuth2Token":{"type":"object","properties":{"accessToken":{"type":"string"},"expiresIn":{"type":"string"},"tokenType":{"type":"string"}}},"echo.HTTPError":{"type":"object","properties":{"message":{}}},"handlers.GenerateTokenPayload":{"type":"object","properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"}}}}}}
```

## 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.3.5"},"servers":[{"url":"https://app.aphex.co/"}],"paths":{"/{region}/v1/auth/token/revoke":{"post":{"description":"Revoke token","summary":"revoke token","parameters":[{"enum":["gb","au"],"type":"string","description":"gb | au","name":"region","in":"path","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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RevokeTokenPayload"}}},"description":"revoke token payload","required":true}}}},"components":{"schemas":{"echo.HTTPError":{"type":"object","properties":{"message":{}}},"handlers.RevokeTokenPayload":{"type":"object","properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"},"token":{"type":"string"}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
