---
title: Get service repository information
description: Returns the repository URL and commit SHA associated with a given service and version.
breadcrumbs: Documentation > API > Get service repository information
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Get service repository information

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                 |
| ----------------- | ---------------------------------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/sourcemaps/service_repository_info     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/sourcemaps/service_repository_info |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/sourcemaps/service_repository_info |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/sourcemaps/service_repository_info      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/sourcemaps/service_repository_info |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/sourcemaps/service_repository_info |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/sourcemaps/service_repository_info |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/sourcemaps/service_repository_info      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/sourcemaps/service_repository_info  |

### Overview

Returns the repository URL and commit SHA associated with a given service and version.

This endpoint requires the `rum_apps_read` permission.

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type   | Description                                                                                            |
| ------------ | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object | Data object for the service repository info request.                                                   |
| data         | attributes [*required*] | object | Attributes for the service repository info request.                                                    |
| attributes   | service [*required*]    | string | The name of the service.                                                                               |
| attributes   | version [*required*]    | string | The version of the service.                                                                            |
| data         | type [*required*]       | enum   | The resource type for service repository info objects. Allowed enum values: `service_repository_info`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "service": "my-web-service",
      "version": "1.0.0"
    },
    "type": "service_repository_info"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing service repository information.

| Parent field | Field                   | Type   | Description                                                                                                                                  |
| ------------ | ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Data object for the service repository info response.                                                                                        |
| data         | attributes [*required*] | object | Attributes of the service repository information.                                                                                            |
| attributes   | commit_sha              | string | The SHA of the commit associated with the service version.                                                                                   |
| attributes   | repository_url          | string | The URL of the source code repository.                                                                                                       |
| attributes   | status [*required*]     | enum   | The status of the service repository info lookup. Allowed enum values: `success`, `not_found`, `no_repository`, `internal_error`, `unknown`. |
| data         | id [*required*]         | string | The identifier composed of the service name and version.                                                                                     |
| data         | type [*required*]       | enum   | The resource type for service repository info objects. Allowed enum values: `service_repository_info`.                                       |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "commit_sha": "abc123def456789",
      "repository_url": "https://github.com/my-org/my-repo",
      "status": "success"
    },
    "id": "my-web-service:1.0.0",
    "type": "service_repository_info"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Unauthorized

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="500" %}
Internal Server Error

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/sourcemaps/service_repository_info" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "service": "my-web-service",
      "version": "1.0.0"
    },
    "type": "service_repository_info"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
