---
title: "Save Gitlab Token Credentials"
method: POST
path: "/organization/vcs/gitlab/credentials"
tags: ["vcs", "organization", "gitlab"]
---

# Save Gitlab Token Credentials

`POST /organization/vcs/gitlab/credentials`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/organization/vcs/gitlab/credentials`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Save GitLab token credentials (create if new or update existing).

## Request body

- GitLabTokenCredentialsRequest: Request to register or update GitLab token credentials.
  - `base_url` string: Base URL for GitLab.com or a self-managed GitLab instance.
  - `token` string, password, required: GitLab access token with api scope. Project and group tokens also require write_repository for Git sync pushes.

## Response `201`

Successful Response

- GitLabTokenCredentialsSaveResponse: Response after creating or updating GitLab token credentials.
  - `message` string, required
  - `action` 'created' | 'updated', required
  - `base_url` string, required

## Other responses

- `422`: Validation Error

---

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