> For the complete documentation index, see [llms.txt](https://developer.textmaster.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.textmaster.com/overview/authentication.md).

# Authentication

Learn how to authenticate through TextMaster API.

While the API provides multiple methods for authentication, we strongly recommend using [OAuth](/apps/about-oauth-apps.md) for production applications. The other method provided is intended to be used for scripts or testing (i.e., cases where full OAuth would be overkill). Third party applications that rely on TextMaster for authentication should not ask for or collect TextMaster credentials. Instead, they should use the OAuth Authorization flow.

## OAuth2

OAuth2 is a protocol that lets external applications request authorization to private details in a user's TextMaster account without accessing their password.

```shell
$ curl https://api.textmaster.com/v1/clients/users/me \
  -H "Authorization: Bearer ACCESS-TOKEN"
```

{% hint style="info" %}
**Tips:** TextMaster recommends sending OAuth tokens using the Authorization header.
{% endhint %}

For more on OAuth Apps, see:

{% content-ref url="/pages/qYrz6Sqapsud2BoZSSbt" %}
[About OAuth Apps](/apps/about-oauth-apps.md)
{% endcontent-ref %}

## Signature

{% hint style="warning" %}
**Warning:** TextMaster discourages using the signature strategy to authenticate production applications to the API. Clients should use [OAuth2 Apps](/apps/about-oauth-apps.md) instead.
{% endhint %}

Signature is an authentication strategy that requires the client to compute a signature hash based on the user's pair of API keys. The signature is only valid for 5 minutes after its creation.

For example, the following Shell script will compute that signature hash:

```shell
#!/bin/bash

APIKEY=somekey
APISECRET=somesecret
DATE=$(date -u +"%Y-%m-%d %H:%M:%S")
SIGNATURE=$(echo -n $APISECRET$DATE | openssl sha1 | sed 's/.*= //')

curl "https://api.textmaster.com/test" \
  -H "Apikey: $APIKEY" \
  -H "Date: $DATE" \
  -H "Signature: $SIGNATURE"
```


---

# 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://developer.textmaster.com/overview/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.
