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

# Delete an associated person

DELETE https://test.api.kota.io/employees/{employee_id}/associated_persons/{associated_person_id}

Permanently deletes an associated person. It cannot be undone.

Reference: https://docs.kota.io/api-reference/associated-persons/delete-associated-person

## Authentication

- `Authorization` header (bearer token, required) — Authorization header using the Bearer scheme

## Servers

- `https://test.api.kota.io` (test, default)
- `https://api.kota.io` (production)

## Request

### Path parameters

- `employee_id` (string, required)
- `associated_person_id` (string, required)

### Headers

- `X-Platform-Id` (string, optional) — The target platform id. Required only when calling with a dashboard (WorkOS AuthKit) access token instead of a platform API key — the token carries no platform claim, so the caller must say which platform it means. Ignored for platform API key / embed session token callers.

## Response

### 200

OK

- `id` (string, required) — Unique identifier for the associated person
- `employee_id` (string, required) — Unique identifier for the employee this person is associated with
- `first_name` (string, required) — First name of the associated person
- `last_name` (string, required) — Last name of the associated person
- `date_of_birth` (date, required) — Date of birth of the associated person
- `sex_at_birth` (enum, required) — The sex assigned to the associated person at birth
  - Allowed values: `male`, `female`
- `relationship_type` (enum, required) — The relationship type between the employee and the associated person
  - Allowed values: `spouse`, `partner`, `child`, `other`
- `platform_id` (string, optional) — Unique identifier for the platform
- `email` (string, optional, nullable) — Email address of the associated person
- `phone_number` (string, optional, nullable) — Phone number in E.164 international format (e.g. +447700900999)
- `object` (string, optional) — The object type

## Errors

### 404 Not Found Error

Not Found

- `type` (string, optional, nullable)
- `title` (string, optional, nullable)
- `status` (integer, optional, nullable)
- `detail` (string, optional, nullable)
- `instance` (string, optional, nullable)

## Examples

**Response**

```json
{
  "id": "ap_3b1333d87d9d4fd6ad83ba7f6b0e951a",
  "employee_id": "ee_3b1333d87d9d4fd6ad83ba7f6b0e951a",
  "first_name": "string",
  "last_name": "string",
  "date_of_birth": "2024-12-01",
  "sex_at_birth": "male",
  "relationship_type": "spouse",
  "platform_id": "pt_3b1333d87d9d4fd6ad83ba7f6b0e951a",
  "email": null,
  "phone_number": null,
  "object": "string"
}
```

**SDK Code**

```python
import requests

url = "https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <apiKey>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")

	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://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <apiKey>'

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.delete("https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://test.api.kota.io/employees/ee_3b1333d87d9d4fd6ad83ba7f6b0e951a/associated_persons/ap_3b1333d87d9d4fd6ad83ba7f6b0e951a")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```