Skip to main content

Get repositories by owner

Retrieve all repositories owned by a specific user or organization.
GET /api/repos/by-owner

Parameters

owner
string
required
The username or organization name that owns the repositories

Response

Returns an array of repository objects.
id
number
Unique identifier for the repository
name
string
Repository name
owner
string
Username of the repository owner
ownerId
string
User ID of the repository owner
description
string
Repository description
isPrivate
boolean
Whether the repository is private

Example request

curl -X GET "https://api.gitflare.dev/api/repos/by-owner?owner=johndoe"

Example response

[
  {
    "id": 1,
    "name": "my-project",
    "owner": "johndoe",
    "ownerId": "user_123",
    "description": "My awesome project",
    "isPrivate": false
  },
  {
    "id": 2,
    "name": "secret-project",
    "owner": "johndoe",
    "ownerId": "user_123",
    "description": "Private repository",
    "isPrivate": true
  }
]

Get repository by owner and name

Retrieve a specific repository by its owner and name.
GET /api/repos/by-owner-and-name

Parameters

owner
string
required
The username or organization name that owns the repository
name
string
required
The repository name

Response

Returns a single repository object.
id
number
Unique identifier for the repository
name
string
Repository name
owner
string
Username of the repository owner
ownerId
string
User ID of the repository owner
description
string
Repository description
isPrivate
boolean
Whether the repository is private

Example request

curl -X GET "https://api.gitflare.dev/api/repos/by-owner-and-name?owner=johndoe&name=my-project"

Example response

{
  "id": 1,
  "name": "my-project",
  "owner": "johndoe",
  "ownerId": "user_123",
  "description": "My awesome project",
  "isPrivate": false
}

Create repository

Create a new Git repository.
POST /api/repos/create

Authentication

This endpoint requires authentication. You must be logged in to create a repository.

Parameters

name
string
required
Repository name. Must be 1-100 characters, contain only letters, numbers, hyphens, and underscores, and cannot end with .git
description
string
required
Repository description. Maximum 500 characters
isPrivate
boolean
required
Whether the repository should be private

Response

Returns the created repository object.
id
number
Unique identifier for the repository
name
string
Repository name
owner
string
Username of the repository owner
ownerId
string
User ID of the repository owner
description
string
Repository description
isPrivate
boolean
Whether the repository is private

Example request

curl -X POST "https://api.gitflare.dev/api/repos/create" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "name": "my-new-project",
    "description": "A new project for testing",
    "isPrivate": false
  }'

Example response

{
  "id": 3,
  "name": "my-new-project",
  "owner": "johndoe",
  "ownerId": "user_123",
  "description": "A new project for testing",
  "isPrivate": false
}

Validation errors

  • Repository name is required: Name cannot be empty
  • Repository name must be less than 100 characters: Name exceeds maximum length
  • Repository name can only contain letters, numbers, hyphens, and underscores: Invalid characters in name
  • Repository name cannot end with .git: Name ends with .git extension
  • Description must be less than 500 characters: Description exceeds maximum length

Update repository

Update an existing repository’s settings.
POST /api/repos/update

Authentication

This endpoint requires authentication. You must be the repository owner to update it.

Parameters

id
number
required
The repository ID to update
description
string
Updated repository description. Maximum 500 characters
isPrivate
boolean
required
Whether the repository should be private

Response

Returns the updated repository object.
id
number
Unique identifier for the repository
name
string
Repository name
owner
string
Username of the repository owner
ownerId
string
User ID of the repository owner
description
string
Updated repository description
isPrivate
boolean
Updated privacy status

Example request

curl -X POST "https://api.gitflare.dev/api/repos/update" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "id": 1,
    "description": "Updated project description",
    "isPrivate": true
  }'

Example response

{
  "id": 1,
  "name": "my-project",
  "owner": "johndoe",
  "ownerId": "user_123",
  "description": "Updated project description",
  "isPrivate": true
}

Error responses

  • Repository not found: The specified repository ID does not exist
  • You do not have permission to update this repository: You are not the repository owner
  • You must be logged in to update a repository: Authentication required

Build docs developers (and LLMs) love