# Check status of a Distribution Release

`POST https://cdn.lingohub.com/v1/distributions/check`

LingoHub CDN API · [Distributions](https://developers.lingohub.com/reference/cdn/operations/tags/distributions.md) · operation `cdnCheck`

Checks whether a new Distribution Release is available for the given environment, type, and optional version/release filters. Requires a valid CDN key as a Bearer token in the Authorization header. Returns 200 with release details if a matching release exists, or 204 if no release matches.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | header | yes | string | CDN key as Bearer token. Format: 'Bearer cdn_<jwt_token>'. |

## Example request

```sh
curl --request POST \
  --url https://cdn.lingohub.com/v1/distributions/check \
  --header 'Authorization: Bearer cdn_eyJhbGciOiJIUz...' \
  --header 'Content-Type: application/json' \
  --data '{
  "clientVersion": "2.1.0",
  "clientRelease": "beta-3",
  "distributionEnvironment": "DEVELOPMENT",
  "distributionType": "NATIVE_FORMAT"
}'
```

## Responses

- `200`: A matching Distribution Release was found.
- `204`: No Distribution Release matches the given filter. The response body is empty.
- `401`: Unauthorized: The Authorization header is missing, malformed, or contains an invalid/expired CDN key.
- `404`: Not Found: No distribution or distribution release matches the given environment, type, and version.
- `422`: Unprocessable Entity: The request body failed validation (e.g. invalid language code or semantic version format).
- `429`: Too Many Requests: The workspace's CDN usage budget has been exceeded. Please add more CDN budget.
- `500`: Internal Server Error: An unexpected error occurred.

## OpenAPI definition

The complete definition of this operation, with every schema it references:

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "LingoHub CDN API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://cdn.lingohub.com",
      "description": "LingoHub CDN"
    }
  ],
  "tags": [
    {
      "name": "Distributions",
      "description": "Endpoints for distribution related operations."
    }
  ],
  "paths": {
    "/v1/distributions/check": {
      "post": {
        "tags": [
          "Distributions"
        ],
        "summary": "Check status of a Distribution Release",
        "description": "Checks whether a new Distribution Release is available for the given environment, type, and optional version/release filters. Requires a valid CDN key as a Bearer token in the Authorization header. Returns 200 with release details if a matching release exists, or 204 if no release matches.",
        "operationId": "cdnCheck",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "CDN key as Bearer token. Format: 'Bearer cdn_<jwt_token>'.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer cdn_eyJhbGciOiJIUz..."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CdnCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A matching Distribution Release was found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CdnCheckResponse"
                },
                "examples": {
                  "Matching release found": {
                    "summary": "A distribution release matching the filter",
                    "description": "Matching release found",
                    "value": {
                      "distributionReleaseId": "rel_019f9d57-d0ec-7fa2-99f2-4ac2eb20e671",
                      "name": "your project release",
                      "createdAt": "2025-02-24T13:11:30.909+00:00",
                      "filesUrl": "https://lingohub-exports.s3.amazonaws.com/distributions/rel_019f9d57-d0ec-7fa2-99f2-4ac2eb20e671.zip"
                    }
                  }
                }
              }
            }
          },
          "204": {
            "description": "No Distribution Release matches the given filter. The response body is empty.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CdnCheckResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: The Authorization header is missing, malformed, or contains an invalid/expired CDN key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CdnErrorDetail"
                },
                "examples": {
                  "Invalid CDN key": {
                    "summary": "CDN key not found or expired",
                    "description": "Invalid CDN key",
                    "value": {
                      "type": "about:blank",
                      "status": 401,
                      "detail": "Unauthorized",
                      "errors": [
                        {
                          "field": "AUTHORIZATION",
                          "infos": [
                            "CDN_KEY_NOT_FOUND"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found: No distribution or distribution release matches the given environment, type, and version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CdnErrorDetail"
                },
                "examples": {
                  "Distribution not found": {
                    "summary": "No matching distribution exists",
                    "description": "Distribution not found",
                    "value": {
                      "type": "about:blank",
                      "status": 404,
                      "detail": "Not Found",
                      "errors": [
                        {
                          "field": "DISTRIBUTION",
                          "infos": [
                            "DISTRIBUTION_NOT_FOUND"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity: The request body failed validation (e.g. invalid language code or semantic version format).",
            "content": {
              "application/json": {}
            }
          },
          "429": {
            "description": "Too Many Requests: The workspace's CDN usage budget has been exceeded. Please add more CDN budget.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CdnErrorDetail"
                },
                "examples": {
                  "Usage limit exceeded": {
                    "summary": "CDN budget exhausted",
                    "description": "Usage limit exceeded",
                    "value": {
                      "type": "about:blank",
                      "status": 429,
                      "detail": "Too Many Requests",
                      "errors": [
                        {
                          "field": "USAGE",
                          "infos": [
                            "USAGE_LIMIT_EXCEEDED"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error: An unexpected error occurred.",
            "content": {
              "application/json": {}
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "CdnCheckRequest": {
        "type": "object",
        "description": "Request body for checking the status of a Distribution Release. Requires mandatory distribution environment and type filters. The client version and release optionally narrow it to a version-specific distribution.",
        "properties": {
          "clientVersion": {
            "type": [
              "string",
              "null"
            ],
            "description": "The semantic version of the client application. Used as an optional filter to match a version-specific distribution.",
            "example": "2.1.0",
            "maxLength": 50,
            "minLength": 0
          },
          "clientRelease": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release identifier of the client application. Used as an optional filter.",
            "example": "beta-3",
            "maxLength": 50,
            "minLength": 0
          },
          "distributionEnvironment": {
            "$ref": "#/components/schemas/DistributionEnvironment",
            "description": "The target distribution environment. This is a mandatory filter.",
            "example": "PRODUCTION"
          },
          "distributionType": {
            "$ref": "#/components/schemas/DistributionType",
            "description": "The target distribution type. This is a mandatory filter.",
            "example": "MOBILE_SDK_IOS"
          }
        },
        "required": [
          "distributionEnvironment",
          "distributionType"
        ]
      },
      "DistributionEnvironment": {
        "type": "string",
        "enum": [
          "DEVELOPMENT",
          "TEST",
          "STAGING",
          "PRODUCTION"
        ]
      },
      "DistributionType": {
        "type": "string",
        "enum": [
          "NATIVE_FORMAT",
          "MOBILE_SDK_ANDROID",
          "MOBILE_SDK_IOS"
        ]
      },
      "CdnCheckResponse": {
        "type": "object",
        "description": "Response containing details of a matching Distribution Release, including its identifier, name, creation timestamp, and a pre-signed download URL.",
        "properties": {
          "distributionReleaseId": {
            "type": "string",
            "description": "The unique identifier of the Distribution Release.",
            "example": "rel_019f9d57-d0ec-7fa2-99f2-4ac2eb20e671"
          },
          "name": {
            "type": "string",
            "description": "The human-readable name of the Distribution Release.",
            "example": "v2.1.0 Production Release"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp when the Distribution Release was created.",
            "example": "2025-02-24T13:11:30"
          },
          "filesUrl": {
            "type": "string",
            "description": "A pre-signed S3 URL to download the Distribution Release files. Valid for 24 hours.",
            "example": "https://lingohub-exports.s3.amazonaws.com/distributions/rel_019f9d57-d0ec-7fa2-99f2-4ac2eb20e671.zip"
          }
        },
        "required": [
          "createdAt",
          "distributionReleaseId",
          "filesUrl",
          "name"
        ]
      },
      "CdnErrorDetail": {
        "type": "object",
        "description": "A structured error detail indicating which field caused the error and the specific error codes.",
        "properties": {
          "field": {
            "$ref": "#/components/schemas/CdnErrorField",
            "description": "The field or area that caused the error.",
            "example": "AUTHORIZATION"
          },
          "infos": {
            "type": "array",
            "description": "The list of error codes describing what went wrong for this field.",
            "items": {
              "$ref": "#/components/schemas/CdnErrorInfo"
            }
          }
        },
        "required": [
          "field",
          "infos"
        ]
      },
      "CdnErrorField": {
        "type": "string",
        "description": "The field or area that caused a CDN error.",
        "enum": [
          "AUTHORIZATION",
          "DISTRIBUTION",
          "DISTRIBUTION_RELEASE",
          "USAGE"
        ]
      },
      "CdnErrorInfo": {
        "type": "string",
        "description": "Specific error code describing the cause of a CDN error.",
        "enum": [
          "HEADER_INVALID",
          "JWT_INVALID",
          "CDN_KEY_NOT_FOUND",
          "CDN_KEY_EXPIRED",
          "DISTRIBUTION_NOT_FOUND",
          "DISTRIBUTION_RELEASE_NOT_FOUND",
          "USAGE_LIMIT_EXCEEDED"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "CDN key authentication. CDN keys belong to a project and use the `cdn_` prefix; API keys are not accepted. Pass the full key as the Bearer token.",
        "scheme": "bearer"
      }
    }
  }
}
````
