> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.callix.dev.br/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.callix.dev.br/_mcp/server.

# Create callback

POST https://sua-conta.callix.com.br/api/v1/callbacks
Content-Type: application/vnd.api+json

Cria um callback (rechamada). `Content-Type: application/vnd.api+json`. `type: "callback"`.

**Atributos**

- `phone` (string, obrigatório): Telefone que será inserido.

**Relacionamentos**

- `call_queue` (`call_queue`, opcional): Fila onde a chamada foi recebida, se existir.

Reference: https://docs.callix.dev.br/api-reference/callbacks/post-callbacks

## Authentication

- `Authorization` header (bearer token, required) — Token de API da conta do tenant.

## Response

### 200

Sucesso.

## Examples

**Request**

```json
{
  "data": {
    "attributes": {
      "phone": "5511999999999"
    },
    "relationships": {
      "call_queue": {
        "data": {
          "id": "1",
          "type": "call_queue"
        }
      }
    },
    "type": "callback"
  }
}
```

**Response**

```json
{
  "data": {
    "attributes": {
      "phone": "+551140020002"
    },
    "id": "1",
    "links": {
      "self": "/api/v1/callbacks/1"
    },
    "relationships": {
      "call_queue": {
        "links": {
          "related": "/api/v1/callbacks/1/call_queue",
          "self": "/api/v1/callbacks/1/relationships/call_queue"
        }
      }
    },
    "type": "callbacks"
  }
}
```

**SDK Code**

```python Callbacks_post_callbacks_example
import requests

url = "https://sua-conta.callix.com.br/api/v1/callbacks"

payload = "{\n  \"data\": {\n    \"attributes\": {\n      \"phone\": \"5511999999999\"\n    },\n    \"relationships\": {\n      \"call_queue\": {\n        \"data\": {\n          \"id\": \"1\",\n          \"type\": \"call_queue\"\n        }\n      }\n    },\n    \"type\": \"callback\"\n  }\n}"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/vnd.api+json"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Callbacks_post_callbacks_example
const url = 'https://sua-conta.callix.com.br/api/v1/callbacks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
  body: '{\n  "data": {\n    "attributes": {\n      "phone": "5511999999999"\n    },\n    "relationships": {\n      "call_queue": {\n        "data": {\n          "id": "1",\n          "type": "call_queue"\n        }\n      }\n    },\n    "type": "callback"\n  }\n}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Callbacks_post_callbacks_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sua-conta.callix.com.br/api/v1/callbacks"

	payload := strings.NewReader("{\n  \"data\": {\n    \"attributes\": {\n      \"phone\": \"5511999999999\"\n    },\n    \"relationships\": {\n      \"call_queue\": {\n        \"data\": {\n          \"id\": \"1\",\n          \"type\": \"call_queue\"\n        }\n      }\n    },\n    \"type\": \"callback\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/vnd.api+json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Callbacks_post_callbacks_example
require 'uri'
require 'net/http'

url = URI("https://sua-conta.callix.com.br/api/v1/callbacks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n  \"data\": {\n    \"attributes\": {\n      \"phone\": \"5511999999999\"\n    },\n    \"relationships\": {\n      \"call_queue\": {\n        \"data\": {\n          \"id\": \"1\",\n          \"type\": \"call_queue\"\n        }\n      }\n    },\n    \"type\": \"callback\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Callbacks_post_callbacks_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sua-conta.callix.com.br/api/v1/callbacks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/vnd.api+json")
  .body("{\n  \"data\": {\n    \"attributes\": {\n      \"phone\": \"5511999999999\"\n    },\n    \"relationships\": {\n      \"call_queue\": {\n        \"data\": {\n          \"id\": \"1\",\n          \"type\": \"call_queue\"\n        }\n      }\n    },\n    \"type\": \"callback\"\n  }\n}")
  .asString();
```

```php Callbacks_post_callbacks_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sua-conta.callix.com.br/api/v1/callbacks', [
  'body' => '{
  "data": {
    "attributes": {
      "phone": "5511999999999"
    },
    "relationships": {
      "call_queue": {
        "data": {
          "id": "1",
          "type": "call_queue"
        }
      }
    },
    "type": "callback"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/vnd.api+json',
  ],
]);

echo $response->getBody();
```

```csharp Callbacks_post_callbacks_example
using RestSharp;

var client = new RestClient("https://sua-conta.callix.com.br/api/v1/callbacks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/vnd.api+json");
request.AddParameter("application/vnd.api+json", "{\n  \"data\": {\n    \"attributes\": {\n      \"phone\": \"5511999999999\"\n    },\n    \"relationships\": {\n      \"call_queue\": {\n        \"data\": {\n          \"id\": \"1\",\n          \"type\": \"call_queue\"\n        }\n      }\n    },\n    \"type\": \"callback\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Callbacks_post_callbacks_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/vnd.api+json"
]

let postData = NSData(data: "{
  "data": {
    "attributes": {
      "phone": "5511999999999"
    },
    "relationships": {
      "call_queue": {
        "data": {
          "id": "1",
          "type": "call_queue"
        }
      }
    },
    "type": "callback"
  }
}".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://sua-conta.callix.com.br/api/v1/callbacks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```