API Documentation
Unified Consent Core API (2.0.0)
Download OpenAPI specification:Download
This is the Unified Consent Core API. Use of this API is subject to the Unfied Consent Core API Terms of Service.
The Unified Consent Core API uses API keys to authenticate requests that are generated on a per-user basis. All calls require a valid, unexpired API key. There are two types of API keys that can be used with the Unified Consent Core API. They are the Osano API key and the Unified Consent API key. Routes that involve creating, updating, or merging subjects require the Osano API key. All other routes require the Unified Consent API key.
Osano API keys may be generated within the Osano settings -> API Keys page. You must be an admin or have the correct privileges to generate an API key.
Once generated, the API key should be included in the x-osano-api-key
header of all that involve creating, updating, or merging subjects. For example:
curl --location 'https://uc.api.osano.com/v2/subject/merge' \
--header 'x-osano-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"sourceSubjectId": "some-source-subject-id",
"targetSubjectId": "some-target-subject-id"
}'
Unified Consent API keys may be generated by using the /v2/token/create
route. First gather the configId
and the customerId
from the Configuration details page. (Select the desired Configuration from the Configurations list page) For example:
curl --location 'https://uc.api.osano.com/v2/token/create' \
--header 'Content-Type: application/json' \
--data '{
"customerId": "some-customer-id",
"configId": "some-config-id"
}'
Note: Unified Consent API keys are scoped to a single Configuration, and will not work to submit consents for another Configuration
Retrieves the unified consent for a subject.
Retrieves the unified consent for a subject.
Authorizations:
path Parameters
subjectRef required | string Anonymous id, verified id, or a valid session id. |
query Parameters
ref | string Enum: "subject" "session" Indicates what type of reference is provided for the subject. Supports a subject id or a session id. |
header Parameters
x-country-code-override | string Valid ISO 3166-1 country code to override the country resolution based on the IP address. |
x-region-code-override | string Valid ISO 3166-2 region code to override the region resolution based on the IP address |
Responses
Response samples
- 200
{- "unifiedConsent": {
- "subjectId": "string",
- "brandId": "string",
- "channelIds": [
- "string"
], - "region": "string",
- "compliance": {
- "privacyPolicy": {
- "version": "string",
- "url": "string"
}, - "gpc": 1
}, - "actions": [
- {
- "target": "string",
- "vendor": "string",
- "action": "string"
}
], - "attributes": null,
- "lastUpdateDate": "string",
- "lastConflictDate": "string"
}, - "conflicts": [
- {
- "type": "string",
- "resolution": "string",
- "actionsInConflict": [
- {
- "target": "string",
- "vendor": "string",
- "action": "string",
- "consentId": "string",
- "channelId": "string",
- "createdAt": "string"
}
]
}
]
}
Checks whether a subject has given consent in a co
Checks whether a subject has given consent in a configuration.
Authorizations:
path Parameters
subjectId required | string |
header Parameters
x-country-code-override | string Valid ISO 3166-1 country code to override the country resolution based on the IP address. |
x-region-code-override | string Valid ISO 3166-2 region code to override the region resolution based on the IP address |
Responses
Response samples
- 200
{- "exists": true
}
Retrieves all collections for given configIds
Retrieves all collections for given configIds
Authorizations:
query Parameters
configId required | string |
customerId | string |
jurisdiction | string |
type | string |
Responses
Response samples
- 200
{- "jurisdictions": [
- "string"
], - "collection": {
- "collectionId": "string",
- "name": "string",
- "frameworks": [
- "string"
], - "configIds": [
- "string"
], - "jurisdiction": "string",
- "created": "string",
- "updated": "string",
- "type": "string",
- "consents": [
- { }
], - "preferences": [
- { }
]
}
}
Retrieves a collection
Retrieves a collection
Authorizations:
path Parameters
collectionId required | string |
query Parameters
customerId | string |
Responses
Response samples
- 200
{- "collectionId": "string",
- "name": "string",
- "frameworks": [
- "string"
], - "configIds": [
- "string"
], - "jurisdiction": "string",
- "created": "string",
- "updated": "string",
- "type": "string",
- "consents": [
- { }
], - "preferences": [
- { }
]
}
Create and insert a consent
Create and insert a consent
Authorizations:
header Parameters
x-country-code-override | string Valid ISO 3166-1 country code to override the country resolution based on the IP address. |
x-region-code-override | string Valid ISO 3166-2 region code to override the region resolution based on the IP address |
Request Body schema: application/json
sessionToken | string Optional session token returned by the create profile endpoint. |
required | object |
object (compliance) | |
required | Array of objects |
attributes required | object |
origin | string |
jurisdiction | string |
Responses
Request samples
- Payload
{- "sessionToken": "string",
- "subject": {
- "verifiedId": "string",
- "anonymousId": "string"
}, - "compliance": {
- "privacyPolicy": {
- "version": "string",
- "url": "string"
}, - "gpc": 1
}, - "actions": [
- {
- "target": "string",
- "vendor": "string",
- "action": "string"
}
], - "attributes": { },
- "origin": "string",
- "jurisdiction": "string"
}
Create and insert a gpc consent
Create and insert a gpc consent
Authorizations:
header Parameters
x-country-code-override | string Valid ISO 3166-1 country code to override the country resolution based on the IP address. |
x-region-code-override | string Valid ISO 3166-2 region code to override the region resolution based on the IP address |
Request Body schema: application/json
required | object |
object (gpc-compliance) | |
attributes required | object |
jurisdiction | string |
Responses
Request samples
- Payload
{- "subject": {
- "verifiedId": "string",
- "anonymousId": "string"
}, - "compliance": {
- "gpc": 1
}, - "attributes": { },
- "jurisdiction": "string"
}
Merge subjects (an anonymous and a verified)
Merge subjects (an anonymous and a verified)
Authorizations:
header Parameters
content-type required | string Value: "application/json" The payload is a valid serialized JSON object |
Request Body schema: application/jsonrequired
sourceSubjectId required | string non-empty |
targetSubjectId required | string non-empty |
Responses
Request samples
- Payload
{- "sourceSubjectId": "string",
- "targetSubjectId": "string"
}
Response samples
- 200
"string"
Create profile verification code
Create profile verification code
Authorizations:
header Parameters
content-type required | string Value: "application/json" The payload is a valid serialized JSON object |
Request Body schema: application/jsonrequired
email required | string <email> non-empty |
Responses
Request samples
- Payload
{- "email": "user@example.com"
}
Response samples
- 201
{- "code": "string"
}
Create and insert a subject profile
Create and insert a subject profile
Authorizations:
query Parameters
resultType | string Enum: "subject" "session" |
header Parameters
content-type required | string Value: "application/json" The payload is a valid serialized JSON object |
Request Body schema: application/jsonrequired
email required | string <email> non-empty |
profile | object |
Responses
Request samples
- Payload
{- "email": "user@example.com",
- "profile": { }
}
Verify a subject profile
Verify a subject profile
Authorizations:
header Parameters
content-type required | string Value: "application/json" The payload is a valid serialized JSON object |
Request Body schema: application/jsonrequired
email required | string <email> non-empty |
code required | string = 6 characters |
Responses
Request samples
- Payload
{- "email": "user@example.com",
- "code": "string"
}
Response samples
- 200
{- "verifiedId": "string"
}