Create Repository in Organization (By Organization ID)

Request

POST

https://api.sourcecraft.tech/orgs/id:{org_id}/repos

Path parameters

Name

Description

org_id

Type: string

Example: ``

Body

application/json
{
  "name": "example",
  "slug": "example",
  "description": "example",
  "visibility": "public",
  "init_settings": {
    "default_branch": "example",
    "create_readme": true,
    "gitignore_presets": [
      "example"
    ],
    "license_slug": "example",
    "src_yaml_template_slug": "example"
  },
  "templating_options": {
    "template_id": "example"
  }
}

Name

Description

name

Type: string

Example: example

slug

Type: string

Example: example

description

Type: string

Example: example

init_settings

Type: InitSettings

Example
{
  "default_branch": "example",
  "create_readme": true,
  "gitignore_presets": [
    "example"
  ],
  "license_slug": "example",
  "src_yaml_template_slug": "example"
}

templating_options

Type: TemplatingOptions

Example
{
  "template_id": "example"
}

visibility

Type: Repository.Visibility

Enum: public, internal, private

Repository.Visibility

Type: string

Enum: public, internal, private

InitSettings

Name

Description

create_readme

Type: boolean

default_branch

Type: string

Example: example

gitignore_presets

Type: string[]

Example
[
  "example"
]

license_slug

Type: string

Example: example

src_yaml_template_slug

Type: string

Example: example

Example
{
  "default_branch": "example",
  "create_readme": true,
  "gitignore_presets": [
    "example"
  ],
  "license_slug": "example",
  "src_yaml_template_slug": "example"
}

TemplatingOptions

Name

Description

template_id

Type: string

Example: example

Example
{
  "template_id": "example"
}

Responses

201 Created

A successful response.

Body

application/json
{
  "id": "example",
  "name": "example",
  "default_branch": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  },
  "slug": "example",
  "template_type": "not_a_template",
  "is_empty": true,
  "description": "example",
  "visibility": "public",
  "logo": {
    "url": "example"
  },
  "clone_url": {
    "https": "example",
    "ssh": "example"
  },
  "web_url": "example",
  "links": [
    {
      "link": "example",
      "type": "social_network"
    }
  ],
  "counters": {
    "forks": "example",
    "pull_requests": "example",
    "issues": "example",
    "tags": "example",
    "branches": "example"
  },
  "last_updated": "2025-01-01T00:00:00Z",
  "language": {
    "name": "example",
    "color": "example"
  },
  "parent": {
    "id": "example",
    "slug": "example",
    "organization": null
  },
  "migration_source": {
    "url": "example",
    "domain": "example"
  }
}

Name

Description

clone_url

Type: CloneURL

Example
{
  "https": "example",
  "ssh": "example"
}

counters

Type: RepositoryCounters

Example
{
  "forks": "example",
  "pull_requests": "example",
  "issues": "example",
  "tags": "example",
  "branches": "example"
}

default_branch

Type: string

Example: example

description

Type: string

Example: example

id

Type: string

Example: example

is_empty

Type: boolean

language

Type: Language

Example
{
  "name": "example",
  "color": "example"
}

last_updated

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

links

Type: Link[]

Example
[
  {
    "link": "example",
    "type": "social_network"
  }
]

logo

Type: Image

Example
{
  "url": "example"
}

migration_source

Type: MigrationSource

Example
{
  "url": "example",
  "domain": "example"
}

name

Type: string

Example: example

organization

Type: OrganizationEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

parent

Type: RepositoryEmbedded

Example
{
  "id": "example",
  "slug": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  }
}

slug

Type: string

Example: example

template_type

Type: RepoTemplate

Enum: not_a_template, organizational, system

visibility

Type: Repository.Visibility

Enum: public, internal, private

web_url

Type: string

Example: example

OrganizationEmbedded

Name

Description

id

Type: string

Example: example

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example"
}

RepoTemplate

Type: string

Enum: not_a_template, organizational, system

Image

Name

Description

url

Type: string

Example: example

Example
{
  "url": "example"
}

CloneURL

Name

Description

https

Type: string

Example: example

ssh

Type: string

Example: example

Example
{
  "https": "example",
  "ssh": "example"
}

Link.LinkType

Type: string

Enum: social_network, homepage, email, telegram

Name

Description

link

Type: string

Example: example

type

Type: Link.LinkType

Enum: social_network, homepage, email, telegram

Example
{
  "link": "example",
  "type": "social_network"
}

RepositoryCounters

Name

Description

branches

Type: string<uint64>

Example: example

forks

Type: string<uint64>

Example: example

issues

Type: string<uint64>

Example: example

pull_requests

Type: string<uint64>

Example: example

tags

Type: string<uint64>

Example: example

Example
{
  "forks": "example",
  "pull_requests": "example",
  "issues": "example",
  "tags": "example",
  "branches": "example"
}

Language

Name

Description

color

Type: string

Example: example

name

Type: string

Example: example

Example
{
  "name": "example",
  "color": "example"
}

RepositoryEmbedded

Name

Description

id

Type: string

Example: example

organization

Type: OrganizationEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  }
}

MigrationSource

Name

Description

domain

Type: string

Example: example

url

Type: string

Example: example

Example
{
  "url": "example",
  "domain": "example"
}

default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": {}
}

Name

Description

details

Type: Optional details. Exact structure depends on error_code

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example

Предыдущая