This feature is in beta
To use this feature, pass in a header including the
LD-API-Version
key with value set tobeta
. Use this header with each call. To learn more, read Beta resources.Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.
Engineering insights automatically creates repository associations when it receives deployments or code references. Optionally, you can manually configure additional associations. You can use the repositories API to list repositories and create associations to projects. To learn more, read Send deployment information.
Get a list of repositories
LaunchDarkly supports expanding the repository collection response to include additional fields.
To expand the response, append the expand
query parameter and include the following:
projects
includes details on all of the LaunchDarkly projects associated with each repositoryFor example, use ?expand=projects
to include the projects
field in the response. By default, this field is not included in the response.
Repository collection response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "totalCount": 1,
- "items": [
- {
- "_id": "5f9a9b1a-5b9a-4b9a-9a9a-9a9a9a9a9a9a",
- "version": 1,
- "key": "launchdarkly/LaunchDarkly-Docs",
- "type": "github",
- "mainBranch": "main",
- "projects": {
- "totalCount": 0,
- "items": [
- {
- "_id": "57be1db38b75bf0772d11383",
- "_links": {
- "environments": {
- "href": "/api/v2/projects/example-project/environments",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/projects/example-project",
- "type": "application/json"
}
}, - "key": "project-key-123abc",
- "name": "Example project"
}
], - "_links": {
- "property1": {
- "href": "string",
- "type": "string"
}, - "property2": {
- "href": "string",
- "type": "string"
}
}
}
}
], - "_links": {
- "property1": {
- "href": "string",
- "type": "string"
}, - "property2": {
- "href": "string",
- "type": "string"
}
}
}
Associate repositories with projects
required | Array of objects (InsightsRepositoryProject) |
Repositories projects response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "mappings": [
- {
- "repositoryKey": "launchdarkly/LaunchDarkly-Docs",
- "projectKey": "default"
}
]
}
{- "totalCount": 1,
- "items": [
- {
- "repositoryKey": "launchdarkly/LaunchDarkly-Docs",
- "projectKey": "default"
}
], - "_links": {
- "property1": {
- "href": "string",
- "type": "string"
}, - "property2": {
- "href": "string",
- "type": "string"
}
}
}
Remove repository project association
Action succeeded
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "code": "invalid_request",
- "message": "validation failed",
- "errors": [
- {
- "attribute": "projectKey",
- "reason": "must be present"
}
]
}