Skip to main content
POST
/
api
/
v1
/
repositories
Create repositories
curl --request POST \
  --url https://api.agenhq.com/api/v1/repositories \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "code_provider_id": "<string>",
  "name": "<string>",
  "full_name": "<string>",
  "clone_url": "<string>",
  "default_branch": "<string>",
  "platform": "<string>",
  "external_id": "<string>",
  "enabled": true
}
'
{
  "id": "<string>",
  "workspace_id": "<string>",
  "code_provider_id": "<string>",
  "name": "<string>",
  "full_name": "<string>",
  "clone_url": "<string>",
  "default_branch": "<string>",
  "platform": "<string>",
  "external_id": "<string>",
  "enabled": true,
  "webhooks_registered": true,
  "webhook_secret": "<string>",
  "analysis_status": "<string>",
  "analysis_error": "<string>",
  "last_analyzed_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.agenhq.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Body

application/json

Fields used to create a repository connection.

Fields used to create a repository connection.

code_provider_id
string
required

The connected code provider account used to access this repository.

name
string
required

The repository name without the owner or namespace.

full_name
string
required

The full repository name including the owner or namespace, for example agenhq/agen.

clone_url
string
required

The git clone URL used by Agen to access the repository contents.

default_branch
string
required

The default branch of the repository, such as main or master.

platform
required

The code hosting platform where the repository is hosted.

Allowed value: "gitlab"
external_id
string
required

The repository identifier used by the external code hosting platform.

enabled
boolean
default:true

Whether Agen can use this repository for sessions and automation.

Response

A repository connected to a workspace.

A repository connected to a workspace.

id
string
required
read-only

The unique identifier of the repository inside Agen.

workspace_id
string
required
read-only

The workspace that owns this repository.

code_provider_id
string
required

The connected code provider account used to access this repository.

name
string
required

The repository name without the owner or namespace.

full_name
string
required

The full repository name including the owner or namespace, for example agenhq/agen.

clone_url
string
required

The git clone URL used by Agen to access the repository contents.

default_branch
string
required

The default branch of the repository, such as main or master.

platform
required

The code hosting platform where the repository is hosted.

Allowed value: "gitlab"
external_id
string
required

The repository identifier used by the external code hosting platform.

enabled
boolean
default:true
required

Whether Agen can use this repository for sessions and automation.

webhooks_registered
boolean
required
read-only

Whether Agen has successfully registered webhooks for this repository.

webhook_secret
string | null
required

The webhook signing secret created by Agen for this repository, if available.

analysis_status
required

The current status of the repository analysis job.

Allowed value: "pending"
analysis_error
string | null
required

The latest repository analysis error message, if analysis failed.

last_analyzed_at
string<date-time> | null
required

When the repository was last analyzed by Agen, if analysis has completed at least once.

created_at
string<date-time>
required
read-only

When the repository record was created in Agen.

updated_at
string<date-time>
required
read-only

When the repository record was last updated in Agen.