API

RepositoryImportSession

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/repository_import_sessions create Success
POST /api/v1/repository_import_sessions/{id}/authorization create Success
POST /api/v1/repository_import_sessions/{id}/cancel create Repository import session
GET /api/v1/repository_import_sessions/{id} load Repository import session

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

repository_import_session, err := client.RepositoryImportSession(nil).Load(map[string]any{"id": "example_id"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(repository_import_session)
created, err := client.RepositoryImportSession(nil).Create(map[string]any{"organization_id": "example", "idempotency_key": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local repository_import_session, err = client:RepositoryImportSession():load({ id = "example_id" })
local created, err = client:RepositoryImportSession():create({ organization_id = "example", idempotency_key = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$repository_import_session = $client->RepositoryImportSession()->load(["id" => "example_id"]);
$created = $client->RepositoryImportSession()->create(["organization_id" => "example", "idempotency_key" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

repository_import_session = client.RepositoryImportSession().load({"id": "example_id"})
created = client.RepositoryImportSession().create({ "organization_id": "example", "idempotency_key": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

repository_import_session = client.RepositoryImportSession.load({ "id" => "example_id" })
created = client.RepositoryImportSession.create({ "organization_id" => "example", "idempotency_key" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const repository_import_session = await client.RepositoryImportSession().load({ id: "example_id" })
const created = await client.RepositoryImportSession().create({ organization_id: "example", idempotency_key: "example" })

Fields

Field Type Required Description
action_required string No Action Required
authorization_endpoint string No Authorization Endpoint
can_authorize_github boolean Yes Can Authorize Github
client_name one,string,null Yes Client Name
client_version one,string,null Yes Client Version
created_at string Yes Created At
error_message one,string,null Yes Error Message
expires_at string Yes Expires At
git_imports array Yes Git Imports
github_app_installation_id one,string,null Yes Github App Installation Id
github_connected boolean Yes Github Connected
id string Yes Id
idempotency_key string Yes Idempotency Key
organization_id string Yes Organization Id
organization_slug string Yes Organization Slug
status string Yes Status
updated_at string Yes Updated At

create

POST /api/v1/organizations/{organization_id}/repository_import_sessions

Operation ID: api_v1_organization_repository_import_sessions.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes

Request body

application/json

Property Type Required Description
client_name string No
client_version string No
github_app_installation_id string No
idempotency_key string Yes

Responses

200: Success

application/json

The response is object.

201: Repository import session

application/json

Property Type Required Description
action_required enum: github_app_installation No
authorization_endpoint string No
can_authorize_github boolean Yes
client_name string Yes
client_version string Yes
created_at string (date-time) Yes
error_message string Yes
expires_at string (date-time) Yes
git_imports array of object Yes
git_imports[].error string No
git_imports[].git_status enum: receiving, durable Yes
git_imports[].git_url string Yes
git_imports[].id string Yes
git_imports[].native_status enum: pending, running, ready, failed, canceled Yes
git_imports[].organization string Yes
git_imports[].repository_id string No
git_imports[].root_path string Yes
git_imports[].slug string Yes
git_imports[].source_branch string Yes
git_imports[].target_branch string Yes
github_app_installation_id string Yes
github_connected boolean Yes
id string Yes
organization_id string Yes
organization_slug string Yes
status enum: pending, running, completed, failed, canceled, expired Yes
updated_at string (date-time) Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/repository_import_sessions/{id}/authorization

Operation ID: authorization_api_v1_repository_import_session.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
id path string Yes

Request body

application/json

The request body is object.

Responses

200: Success

application/json

The response is object.

201: One-time GitHub App installation continuation URL. Never contains API bearer credentials

application/json

Property Type Required Description
installation_url string (uri) Yes Short-lived signed browser URL. Treat as sensitive and do not log.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/repository_import_sessions/{id}/cancel

Operation ID: cancel_api_v1_repository_import_session.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
id path string Yes

Request body

application/json

Property Type Required Description
message string No

Responses

200: Repository import session

application/json

Property Type Required Description
action_required enum: github_app_installation No
authorization_endpoint string No
can_authorize_github boolean Yes
client_name string Yes
client_version string Yes
created_at string (date-time) Yes
error_message string Yes
expires_at string (date-time) Yes
git_imports array of object Yes
git_imports[].error string No
git_imports[].git_status enum: receiving, durable Yes
git_imports[].git_url string Yes
git_imports[].id string Yes
git_imports[].native_status enum: pending, running, ready, failed, canceled Yes
git_imports[].organization string Yes
git_imports[].repository_id string No
git_imports[].root_path string Yes
git_imports[].slug string Yes
git_imports[].source_branch string Yes
git_imports[].target_branch string Yes
github_app_installation_id string Yes
github_connected boolean Yes
id string Yes
organization_id string Yes
organization_slug string Yes
status enum: pending, running, completed, failed, canceled, expired Yes
updated_at string (date-time) Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

load

GET /api/v1/repository_import_sessions/{id}

Operation ID: api_v1_repository_import_session.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
id path string Yes

Responses

200: Repository import session

application/json

Property Type Required Description
action_required enum: github_app_installation No
authorization_endpoint string No
can_authorize_github boolean Yes
client_name string Yes
client_version string Yes
created_at string (date-time) Yes
error_message string Yes
expires_at string (date-time) Yes
git_imports array of object Yes
git_imports[].error string No
git_imports[].git_status enum: receiving, durable Yes
git_imports[].git_url string Yes
git_imports[].id string Yes
git_imports[].native_status enum: pending, running, ready, failed, canceled Yes
git_imports[].organization string Yes
git_imports[].repository_id string No
git_imports[].root_path string Yes
git_imports[].slug string Yes
git_imports[].source_branch string Yes
git_imports[].target_branch string Yes
github_app_installation_id string Yes
github_connected boolean Yes
id string Yes
organization_id string Yes
organization_slug string Yes
status enum: pending, running, completed, failed, canceled, expired Yes
updated_at string (date-time) Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway