Skip to content

Commit 140762d

Browse files
committed
add responses
1 parent 0f32c0b commit 140762d

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

src/unify/identity-resolution/delete-profile-identifier-api.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,85 @@ The Delete Profile Identifier API confirms that Segment deleted the identifier f
5151
2. Batch Profile Data lakehouse: Segment soft-deletes the identifier (flags it as deleted) in the append-only table within minutes. The identifier filters out from the materialized view within 24 hours.
5252
3. Customer data warehouse: Profile Sync sends a deletion notification to your warehouse. The `external_id_mapping_updates` table shows the identifier with `__operation` set to `REMOVED`. The `user_identifiers` materialized view filters out removed identifiers.
5353

54-
<!-- maybe come back and turn this into a table?-->
54+
<!-- maybe come back and turn this into a table?-->
55+
56+
## Delete an identifier
57+
58+
You can only delete identifiers from known profiles. The API requires a valid `user_id` to locate the profile.
59+
60+
The API returns an error if you try to delete:
61+
62+
- All `user_id` values from a profile. Profiles must have at least one `user_id`.
63+
- A `group_id` identifier. The API only supports individual profiles.
64+
65+
### API request format
66+
67+
The API accepts one identifier per request.
68+
69+
**Endpoint**:
70+
```
71+
POST https://{HOST_NAME}/v1/spaces/{SPACE_ID}/collections/users/profiles/user_id:{USER_ID_VALUE}/external_ids/delete
72+
```
73+
74+
**Parameters**:
75+
76+
| Parameter | Description |
77+
| ----------------- | ---------------------------------------------------------------------------------------------------- |
78+
| **HOST_NAME** | `profiles.segment.com` for North America workspaces or `profiles.euw1.segment.com` for EU workspaces |
79+
| **SPACE_ID** | Your space ID. Find this in **Unify > Settings > API access** |
80+
| **USER_ID_VALUE** | The `user_id` value that identifies the profile |
81+
| **AUTH_TOKEN** | Your access token. Generate this in **Unify > Settings > API access** |
82+
83+
**Request body**:
84+
85+
| Field | Description |
86+
| ----------------------- | ------------------------------------------------------------------------------ |
87+
| **delete_external_ids** | Array containing the identifier to delete. Limit: 1 identifier per request |
88+
| **id** | Value of the identifier to delete (for example, `hello@gmail.com`) |
89+
| **type** | Type of identifier to delete (for example, `email`, `anonymous_id`, `user_id`) |
90+
91+
<!--change parameters to code styling, add intros between table headers -->
92+
93+
### Example request
94+
95+
First, base64-encode your access token with a trailing colon:
96+
97+
```bash
98+
echo -n 'your_token:' | base64
99+
```
100+
101+
Then send the delete request:
102+
103+
```bash
104+
curl --location --request POST 'https://profiles.segment.com/v1/spaces/spa_abc123/collections/users/profiles/user_id:user_001/external_ids/delete' \
105+
--header 'Authorization: Basic <base64_encoded_token_colon>' \
106+
--header 'Content-Type: application/json' \
107+
--data '{
108+
"delete_external_ids": [
109+
{
110+
"id": "example@gmail.com",
111+
"type": "email"
112+
}
113+
]
114+
}'
115+
```
116+
## Responses and error codes
117+
118+
## HTTP responses
119+
120+
| HTTP Code | Code | Message |
121+
| --------- | -------------------- | --------------------------------------------------------------------- |
122+
| 200 | success | external identifier has been deleted |
123+
| 400 | unsupported_eid_type | unsupported external id type |
124+
| 400 | bad_request | missing required parameters in URL |
125+
| 400 | bad_request | invalid URL: valid `user_id` is required. unsupported `<id type>` |
126+
| 400 | bad_request | only one external_id can be deleted at a time |
127+
| 400 | bad_request | invalid collection: `<collection>` |
128+
| 400 | bad_request | external id specification must differ from lookup id |
129+
| 401 | unauthorized | the specified token is invalid |
130+
| 403 | forbidden | Deleted identifier not activated for space_id `<space_id>` |
131+
| 404 | not_found | the resource was not found |
132+
| 404 | eid_not_found | external identifier not found |
133+
| 404 | source_id_not_found | no source attached to space_id `<space_id>` |
134+
| 429 | rate_limit_error | Attempted to delete more than 100 IDs per second for a single profile |
135+

0 commit comments

Comments
 (0)