# Text Intelligence Callback

`callback` _string_

Text Intelligence

Deepgram’s Callback feature allows you to supply a callback URL to which text can be returned. When passed, Deepgram will immediately respond with a `request_id` before processing your text asynchronously.

## Enable Feature

To enable Callback, when you call Deepgram’s API, add a `callback` parameter in the query string and set it to the URL to which you would like transcriptions sent:

`callback=URL`

```bash
```

## URL Structure

An example URL is `https://example.com/callback`.

Your callback URLs may reference the following protocols:

- `http` or `https`

## Authenticating Callback Requests

Authentication ensures the security and integrity of callback requests. There are two main methods for authenticating callback requests: using Basic Auth and utilizing the dg-token request header.

### Using Basic Auth

You may embed username-password authentication credentials in the callback URL in the format `https://username:[email protected]`. However, it’s important to note that only ports 80, 443, 8080, and 8443 are permitted for callbacks.

:::callout{intent="warning"}
Only ports 80, 443, 8080, and 8443 are permitted for callbacks.
:::

### Using the `dg-token` Request Header

Alternatively, the callback request itself contains a header named dg-token. This header is automatically set to the API Key Identifier associated with the API Key used to submit the original request. This method provides a secure and straightforward means of authentication.

## Results

Depending on the type of submitted text, the response will vary.

### Text

When Deepgram has finished analyzing the text, it will send a `POST` request to the provided callback URL with an appropriate HTTP status code.

If the HTTP status code of the response to the callback `POST` request is unsuccessful (not 200-299), Deepgram will retry the callback up to 10 times with a 30 second delay between attempts.

## Using `CallBack_Method`

To enable the Callback Method, include the `callback_method` parameter in the query string. By default, the method supports `POST`, but you can specify `PUT` instead.

```bash
```

## Related pages

- [Amazon SageMaker](./amazon-sagemaker-index.md)
- [API Reference](./api-reference-index.md)
- [Aura](./aura-index.md)
- [Changelog](../changelog.md)
- [Deepgram's Docs](../index.md)
- [Docker/Podman](./docker-podman-index.md)
- [Flux TTS](./flux-tts-index.md)
- [Guides](./guides-index.md)
- [Home](./home-index.md)
- [Intelligence](./intelligence-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
