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

ParameterTypeRequiredDescription
organisation_idintegerYesYour organisation's numeric identifier.

Query Parameters

ParameterTypeRequiredDescription
include_inactive_contractsbooleanNoWhen 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": []
}
FieldTypeDescription
contract_idintegerUnique identifier for the contract. Used as policy_id in pricing and ordering endpoints.
namestringHuman-readable name of the contract.
organisation_idintegerID of the owning organisation.
currencystringISO 4217 currency code (e.g. EUR, USD).
default_contractbooleantrue if this is the organisation's default contract. Use this contract when you have no specific reason to choose another.
activebooleanWhether the contract is currently active.
automated_taskingbooleanWhether automated tasking is enabled under this contract.
manual_taskingbooleanWhether manual tasking is enabled under this contract.
systematic_taskingbooleanWhether systematic tasking is enabled under this contract.
enhanced_qabooleanWhether enhanced QA processing is enabled under this contract.
tasking_start_date_utcstring (ISO 8601)Start of the window during which tasking requests can be submitted.
tasking_end_date_utcstring (ISO 8601)End of the tasking window.
order_start_date_utcstring (ISO 8601)Start of the window during which orders can be placed.
order_end_date_utcstring (ISO 8601)End of the order window.
contract_productsarrayProducts available under this contract.
contract_termsarrayTerms 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

ParameterTypeRequiredDescription
policy_idintegerYesThe 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

Pricing API | Purchasing Catalog Images