Policies API
A policy (also called a contract) defines the terms under which your organisation interacts with DataCosmos — including which tasking modes are enabled, the currency used for purchases, applicable pricing, and the validity window for orders and tasking. A contract_id (referred to as policy_id in DPAP endpoints) is required when retrieving prices or placing orders.
NOTE
All endpoints require a valid bearer token and the OAuth2 scope data:tasking:contract:read. See the Authentication page for details.
Get Policies for an Organisation
Returns all policies associated with a given organisation. Use this endpoint to discover your contract_id before placing orders or retrieving pricing.
Endpoint
GET https://app.open-cosmos.com/api/data/v1/dpap/organisations/{organisation_id}/policies
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
organisation_id | integer | Yes | Your organisation's numeric identifier. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
include_inactive_contracts | boolean | No | When true, includes inactive contracts in the response. Defaults to false. |
Response
An array of contract objects.
{
"data": [
{
"contract_id": 1001,
"name": "Standard Contract",
"organisation_id": 50,
"currency": "EUR",
"default_contract": true,
"active": true,
"automated_tasking": true,
"manual_tasking": true,
"systematic_tasking": false,
"enhanced_qa": false,
"tasking_start_date_utc": "2023-01-01T00:00:00Z",
"tasking_end_date_utc": "2024-12-31T23:59:59Z",
"order_start_date_utc": "2023-01-01T00:00:00Z",
"order_end_date_utc": "2024-12-31T23:59:59Z",
"contract_products": [],
"contract_terms": []
}
],
"errors": []
}
| Field | Type | Description |
|---|---|---|
contract_id | integer | Unique identifier for the contract. Used as policy_id in pricing and ordering endpoints. |
name | string | Human-readable name of the contract. |
organisation_id | integer | ID of the owning organisation. |
currency | string | ISO 4217 currency code (e.g. EUR, USD). |
default_contract | boolean | true if this is the organisation's default contract. Use this contract when you have no specific reason to choose another. |
active | boolean | Whether the contract is currently active. |
automated_tasking | boolean | Whether automated tasking is enabled under this contract. |
manual_tasking | boolean | Whether manual tasking is enabled under this contract. |
systematic_tasking | boolean | Whether systematic tasking is enabled under this contract. |
enhanced_qa | boolean | Whether enhanced QA processing is enabled under this contract. |
tasking_start_date_utc | string (ISO 8601) | Start of the window during which tasking requests can be submitted. |
tasking_end_date_utc | string (ISO 8601) | End of the tasking window. |
order_start_date_utc | string (ISO 8601) | Start of the window during which orders can be placed. |
order_end_date_utc | string (ISO 8601) | End of the order window. |
contract_products | array | Products available under this contract. |
contract_terms | array | Terms and conditions associated with this contract. |
Examples
Bash
curl --request GET \
"https://app.open-cosmos.com/api/data/v1/dpap/organisations/50/policies" \
--header "Authorization: Bearer ${DATACOSMOS_ACCESS_TOKEN}"
Python
import requests
# Get bearer token and add to session (see Authentication docs)
response = session.get(
"https://app.open-cosmos.com/api/data/v1/dpap/organisations/50/policies",
)
response.raise_for_status()
contracts = response.json()["data"]
default = next(c for c in contracts if c["default_contract"])
print(f"Default contract ID: {default['contract_id']}")
Get a Policy by ID
Returns a single policy by its ID.
Endpoint
GET https://app.open-cosmos.com/api/data/v1/dpap/policies/{policy_id}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
policy_id | integer | Yes | The numeric ID of the policy (same value as contract_id). |
Response
A single contract object with the same shape as the entries returned by the list endpoint.
{
"data": {
"contract_id": 1001,
"name": "Standard Contract",
"organisation_id": 50,
"currency": "EUR",
"default_contract": true,
"active": true,
"automated_tasking": true,
"manual_tasking": true,
"systematic_tasking": false,
"enhanced_qa": false,
"tasking_start_date_utc": "2023-01-01T00:00:00Z",
"tasking_end_date_utc": "2024-12-31T23:59:59Z",
"order_start_date_utc": "2023-01-01T00:00:00Z",
"order_end_date_utc": "2024-12-31T23:59:59Z",
"contract_products": [],
"contract_terms": []
},
"errors": []
}
Examples
Bash
curl --request GET \
"https://app.open-cosmos.com/api/data/v1/dpap/policies/1001" \
--header "Authorization: Bearer ${DATACOSMOS_ACCESS_TOKEN}"
Python
import requests
# Get bearer token and add to session (see Authentication docs)
response = session.get(
"https://app.open-cosmos.com/api/data/v1/dpap/policies/1001",
)
response.raise_for_status()
contract = response.json()["data"]
print(f"Contract: {contract['name']} ({contract['currency']})")
Where to Next