---
title: "List service account Git credentials"
method: GET
path: "/api/v0/service-accounts/{serviceAccountId}/git-credentials"
tags: ["Service Accounts"]
---

# List service account Git credentials

`GET /api/v0/service-accounts/{serviceAccountId}/git-credentials`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/v0/service-accounts/{serviceAccountId}/git-credentials`
- Auth: HTTP bearer

Returns the Git credentials stored on a service account, as metadata only: the token is never returned. Also lists the Git providers that accept a credential and, when the organization's self-hosted GitLab is connected, its host. Open to Managers, the account's owners, and members who may use the agent profile that runs as the account. Service account credentials are rejected. Not available on self-hosted deployments.

## Path parameters

- `serviceAccountId` string, required

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- ListServiceAccountGitCredentials200ResponseBody
  - `gitCredentials` object[], required
    - `integration` string, required: Git provider the token is for, such as `gitlab` or `gitlab-sh`. More values may be added; treat a value you do not know as unknown.
    - `host` string, required: Host the token authenticates against.
    - `username` string, required: Provider username the token resolved to when it was saved.
    - `gitlabUsername` string: Earlier name for `username` on GitLab credentials.
    - `commitAuthorName` string: Commit author name pinned for this credential.
    - `commitAuthorEmail` string: Commit author email pinned for this credential.
    - `tokenOwnerEmail` string: Commit email of the account the token authenticates as, read from the provider when the token was saved. Used when no email is pinned.
    - `createdAt` number: When the credential was first saved, in milliseconds since the Unix epoch.
    - `updatedAt` number: When the credential was last changed, in milliseconds since the Unix epoch.
  - `supportedIntegrations` string[], required: Git providers that accept a service account credential. More values may be added.
  - `gitlabSelfHostedHost` string: Host of the organization's self-hosted GitLab, when that integration is connected.

## Other responses

- `400`: Response for status 400
- `401`: Response for status 401
- `402`: Response for status 402
- `403`: Response for status 403
- `404`: Response for status 404
- `451`: Response for status 451
- `500`: Response for status 500
- `503`: Response for status 503

## Changes

- **2026-11-18** `7767ce7900e0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/service-accounts/:serviceAccountId/git-credentials/get.md)

---

[API](https://skmtc.dev/factory/apis/factory-public-api.md) - [All operations](https://skmtc.dev/factory/apis/factory-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/factory/apis/factory-public-api/revisions/2e37e1b079d2?raw)
