> For the complete documentation index, see [llms.txt](https://docs.soda.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.soda.io/apis/rest-api/licensing.md).

# Licensing

Soda Cloud API Licensing Endpoints

## Get SPU consumption

> This endpoint returns the number of SPUs your organization consumed over a period.\
> \
> Both bounds are inclusive whole days and any time component is discarded:\
> \
> \- \`from\`: Optional. Defaults to the first day of the current calendar month.\
> \
> \- \`to\`: Optional. Defaults to today.\
> \
> Only organizations on SPU-based licensing accumulate consumption. Any other organization is refused with a 400 \`organisation\_not\_on\_spu\_plan\` error, so a zero total always means nothing was consumed over the period.\
> \
> \## Authentication\
> \
> User authentication required: \`true\`\
> \
> This endpoint accepts authentication via API keys in the \`Basic\` authentication header, or a pre-authenticated token in HTTP cookie \`token\`. Cookie sessions extend automatically on each request.\
> \
> \## Authorization\
> \
> Users must have global role permission MANAGE\_ORGANISATION\_SETTINGS to execute this call.\
> \
> \## Tags\
> \
> \`Licensing\`\
> \
> \## Rate limiting\
> \
> 60 requests/60 seconds

```json
{"openapi":"3.1.0","info":{"title":"Soda Cloud API v4","version":"v1"},"tags":[{"description":"Soda Cloud API Licensing Endpoints","name":"Licensing"}],"servers":[{"description":"Cloud EU","url":"https://cloud.soda.io"},{"description":"Cloud US","url":"https://cloud.us.soda.io"}],"security":[{"basicAuthApiKey":[]},{"cookieToken":[]}],"components":{"securitySchemes":{"basicAuthApiKey":{"scheme":"basic","type":"http"},"cookieToken":{"in":"cookie","name":"token","type":"apiKey"}},"schemas":{"PublicApiSpuConsumptionResponse":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"spusConsumed":{"type":"integer","format":"int64"},"to":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/licensing/spuConsumption":{"get":{"description":"This endpoint returns the number of SPUs your organization consumed over a period.\n\nBoth bounds are inclusive whole days and any time component is discarded:\n\n- `from`: Optional. Defaults to the first day of the current calendar month.\n\n- `to`: Optional. Defaults to today.\n\nOnly organizations on SPU-based licensing accumulate consumption. Any other organization is refused with a 400 `organisation_not_on_spu_plan` error, so a zero total always means nothing was consumed over the period.\n\n## Authentication\n\nUser authentication required: `true`\n\nThis endpoint accepts authentication via API keys in the `Basic` authentication header, or a pre-authenticated token in HTTP cookie `token`. Cookie sessions extend automatically on each request.\n\n## Authorization\n\nUsers must have global role permission MANAGE_ORGANISATION_SETTINGS to execute this call.\n\n## Tags\n\n`Licensing`\n\n## Rate limiting\n\n60 requests/60 seconds","operationId":"GET/api/v1/licensing/spuConsumption","parameters":[{"in":"query","name":"from","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/PublicApiSpuConsumptionResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests"},"500":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"}},"summary":"Get SPU consumption","tags":["Licensing"]}}}}
```

## Get SPU consumption per dataset

> This endpoint returns the SPUs your organization consumed over a period, per dataset, ordered by consumption with the largest consumer first.\
> \
> Both bounds are inclusive whole days and any time component is discarded. The period may span at most 92 days:\
> \
> \- \`from\`: Optional. Defaults to the first day of the current calendar month.\
> \
> \- \`to\`: Optional. Defaults to today.\
> \
> \- \`cursor\`: Omit for the first page. Pass the previous response's \`nextCursor\`, with the same other parameters, to continue after its last item. Cursors are opaque; invalid cursors return 400.\
> \
> \- \`size\`: Number of datasets per page, from 1 to 1000, default 100.\
> \
> Every page repeats \`spusConsumed\`, the same total \`/api/v1/licensing/spuConsumption\` returns for the period, and \`unattributedSpus\`, the part of it that is not tied to any dataset. The datasets of all pages plus \`unattributedSpus\` add up to \`spusConsumed\`, unless the datasets alone exceed it, for example over a day whose total is not recorded yet. \`unattributedSpus\` is then 0. An absent \`nextCursor\` marks the last page.\
> \
> A dataset that has since been deleted is still listed, by id, without a dataset or datasource name.\
> \
> Only organizations on SPU-based licensing accumulate consumption. Any other organization is refused with a 400 \`organisation\_not\_on\_spu\_plan\` error.\
> \
> \## Authentication\
> \
> User authentication required: \`true\`\
> \
> This endpoint accepts authentication via API keys in the \`Basic\` authentication header, or a pre-authenticated token in HTTP cookie \`token\`. Cookie sessions extend automatically on each request.\
> \
> \## Authorization\
> \
> Users must have global role permission MANAGE\_ORGANISATION\_SETTINGS to execute this call.\
> \
> \## Tags\
> \
> \`Licensing\`\
> \
> \## Rate limiting\
> \
> 60 requests/60 seconds

```json
{"openapi":"3.1.0","info":{"title":"Soda Cloud API v4","version":"v1"},"tags":[{"description":"Soda Cloud API Licensing Endpoints","name":"Licensing"}],"servers":[{"description":"Cloud EU","url":"https://cloud.soda.io"},{"description":"Cloud US","url":"https://cloud.us.soda.io"}],"security":[{"basicAuthApiKey":[]},{"cookieToken":[]}],"components":{"securitySchemes":{"basicAuthApiKey":{"scheme":"basic","type":"http"},"cookieToken":{"in":"cookie","name":"token","type":"apiKey"}},"schemas":{"PublicApiSpuDatasetConsumptionResponse":{"type":"object","properties":{"content":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/DatasetSpuConsumptionDTO"}},"from":{"type":"string","format":"date-time"},"nextCursor":{"type":"string"},"spusConsumed":{"type":"integer","format":"int64","description":"Total over the whole period and every dataset, not over this page."},"to":{"type":"string","format":"date-time"},"unattributedSpus":{"type":"integer","format":"int64","description":"The part of spusConsumed that is not tied to any dataset, over the whole period. It is not part of content."}},"required":["content","from","spusConsumed","to","unattributedSpus"]},"DatasetSpuConsumptionDTO":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string","description":"Null when the dataset has since been deleted."},"datasourceName":{"type":"string","description":"Null when the dataset has since been deleted."},"spusConsumed":{"type":"integer","format":"int64"}},"required":["datasetId","spusConsumed"]},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/licensing/spuConsumption/datasets":{"get":{"description":"This endpoint returns the SPUs your organization consumed over a period, per dataset, ordered by consumption with the largest consumer first.\n\nBoth bounds are inclusive whole days and any time component is discarded. The period may span at most 92 days:\n\n- `from`: Optional. Defaults to the first day of the current calendar month.\n\n- `to`: Optional. Defaults to today.\n\n- `cursor`: Omit for the first page. Pass the previous response's `nextCursor`, with the same other parameters, to continue after its last item. Cursors are opaque; invalid cursors return 400.\n\n- `size`: Number of datasets per page, from 1 to 1000, default 100.\n\nEvery page repeats `spusConsumed`, the same total `/api/v1/licensing/spuConsumption` returns for the period, and `unattributedSpus`, the part of it that is not tied to any dataset. The datasets of all pages plus `unattributedSpus` add up to `spusConsumed`, unless the datasets alone exceed it, for example over a day whose total is not recorded yet. `unattributedSpus` is then 0. An absent `nextCursor` marks the last page.\n\nA dataset that has since been deleted is still listed, by id, without a dataset or datasource name.\n\nOnly organizations on SPU-based licensing accumulate consumption. Any other organization is refused with a 400 `organisation_not_on_spu_plan` error.\n\n## Authentication\n\nUser authentication required: `true`\n\nThis endpoint accepts authentication via API keys in the `Basic` authentication header, or a pre-authenticated token in HTTP cookie `token`. Cookie sessions extend automatically on each request.\n\n## Authorization\n\nUsers must have global role permission MANAGE_ORGANISATION_SETTINGS to execute this call.\n\n## Tags\n\n`Licensing`\n\n## Rate limiting\n\n60 requests/60 seconds","operationId":"GET/api/v1/licensing/spuConsumption/datasets","parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"from","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"size","schema":{"type":"integer","format":"int32"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/PublicApiSpuDatasetConsumptionResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests"},"500":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"}},"summary":"Get SPU consumption per dataset","tags":["Licensing"]}}}}
```

## Get licensing plan

> This endpoint returns the licensing plan your organization is on, along with the limits that plan grants.\
> \
> Use it to find out what your organization is entitled to before a tool or pipeline decides what it may do. It reports the limits only, not how much of them is already used: pair it with \`/api/v1/licensing/spuConsumption\` for the SPUs consumed over a period.\
> \
> An organization that is on no plan at all is answered with a 404 \`licensing\_not\_found\` error, so a 200 always carries a plan.\
> \
> \## Authentication\
> \
> User authentication required: \`true\`\
> \
> This endpoint accepts authentication via API keys in the \`Basic\` authentication header, or a pre-authenticated token in HTTP cookie \`token\`. Cookie sessions extend automatically on each request.\
> \
> \## Authorization\
> \
> Users must have global role permission MANAGE\_ORGANISATION\_SETTINGS to execute this call.\
> \
> \## Tags\
> \
> \`Licensing\`\
> \
> \## Rate limiting\
> \
> 60 requests/60 seconds

```json
{"openapi":"3.1.0","info":{"title":"Soda Cloud API v4","version":"v1"},"tags":[{"description":"Soda Cloud API Licensing Endpoints","name":"Licensing"}],"servers":[{"description":"Cloud EU","url":"https://cloud.soda.io"},{"description":"Cloud US","url":"https://cloud.us.soda.io"}],"security":[{"basicAuthApiKey":[]},{"cookieToken":[]}],"components":{"securitySchemes":{"basicAuthApiKey":{"scheme":"basic","type":"http"},"cookieToken":{"in":"cookie","name":"token","type":"apiKey"}},"schemas":{"PublicApiOrganisationLicensingResponse":{"type":"object","properties":{"plan":{"type":"object","$ref":"#/components/schemas/PublicApiPlanDTO"},"planFeatures":{"type":"object","$ref":"#/components/schemas/PublicApiPlanFeaturesDTO","description":"The limits the plan grants."},"subscription":{"type":"object","$ref":"#/components/schemas/PublicApiSubscriptionDTO"},"trialExpirationTime":{"type":"string","format":"date-time","description":"Only set while the organization is on the trial plan."}}},"PublicApiPlanDTO":{"type":"string","enum":["trial","free","starter","premier","enterprise","teams","enterpriseUserBased","datasetStandard","spus"]},"PublicApiPlanFeaturesDTO":{"type":"object","properties":{"activeChecks":{"type":"integer","format":"int32"},"authorUsers":{"type":"integer","format":"int32"},"concurrentScans":{"type":"integer","format":"int32"},"datasetCount":{"type":"integer","format":"int32"},"prepaidSPUs":{"type":"integer","format":"int64"},"users":{"type":"integer","format":"int32"}},"required":["concurrentScans"]},"PublicApiSubscriptionDTO":{"type":"object","properties":{"endDate":{"type":"string","format":"date-time"},"startDate":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/organisation/licensing":{"get":{"description":"This endpoint returns the licensing plan your organization is on, along with the limits that plan grants.\n\nUse it to find out what your organization is entitled to before a tool or pipeline decides what it may do. It reports the limits only, not how much of them is already used: pair it with `/api/v1/licensing/spuConsumption` for the SPUs consumed over a period.\n\nAn organization that is on no plan at all is answered with a 404 `licensing_not_found` error, so a 200 always carries a plan.\n\n## Authentication\n\nUser authentication required: `true`\n\nThis endpoint accepts authentication via API keys in the `Basic` authentication header, or a pre-authenticated token in HTTP cookie `token`. Cookie sessions extend automatically on each request.\n\n## Authorization\n\nUsers must have global role permission MANAGE_ORGANISATION_SETTINGS to execute this call.\n\n## Tags\n\n`Licensing`\n\n## Rate limiting\n\n60 requests/60 seconds","operationId":"GET/api/v1/organisation/licensing","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/PublicApiOrganisationLicensingResponse"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found"},"429":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many requests"},"500":{"content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error"}},"summary":"Get licensing plan","tags":["Licensing"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.soda.io/apis/rest-api/licensing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
