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

# Post new CAD data for an agency

POST https://api.stage.abelpolice.com/v1/agencies/{agency_id}/cad
Content-Type: application/xml

Reference: https://docs.api.abelpolice.com/api-reference/agencies/post-agency-cad-v-1-agencies-agency-id-cad-post

## Request

### Path parameters

- `agency_id` (string, required) — The ID of the agency to post CAD data for

### Headers

- `x-api-key` (string, required) — API key or token

### Body (application/xml)

This endpoint expects a string.

- `string`

## Response

### 200

Successful Response

- `agency_id` (string, required)

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, required)

### 403 Forbidden Error

Access Denied

- `detail` (string, required)

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
"string"
```

**Response**

```json
{
  "agency_id": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.stage.abelpolice.com/v1/agencies/agency_id/cad"

payload = "\"string\""
headers = {
    "x-api-key": "<api-key>",
    "Content-Type": "application/xml"
}

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

print(response.json())
```

```javascript
const url = 'https://api.stage.abelpolice.com/v1/agencies/agency_id/cad';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/xml'},
  body: '"string"'
};

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

```go
package main

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

func main() {

	url := "https://api.stage.abelpolice.com/v1/agencies/agency_id/cad"

	payload := strings.NewReader("\"string\"")

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

	req.Header.Add("x-api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/xml")

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

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

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

}
```

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

url = URI("https://api.stage.abelpolice.com/v1/agencies/agency_id/cad")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/xml'
request.body = "\"string\""

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

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

HttpResponse<String> response = Unirest.post("https://api.stage.abelpolice.com/v1/agencies/agency_id/cad")
  .header("x-api-key", "<api-key>")
  .header("Content-Type", "application/xml")
  .body("\"string\"")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.stage.abelpolice.com/v1/agencies/agency_id/cad', [
  'body' => '"string"',
  'headers' => [
    'Content-Type' => 'application/xml',
    'x-api-key' => '<api-key>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.stage.abelpolice.com/v1/agencies/agency_id/cad");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<api-key>");
request.AddHeader("Content-Type", "application/xml");
request.AddParameter("application/xml", "\"string\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<api-key>",
  "Content-Type": "application/xml"
]

let postData = NSData(data: ""string"".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://api.stage.abelpolice.com/v1/agencies/agency_id/cad")! 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()
```