# Generar un token de API de GitLab

Si su GitLab es autohospedado o simplemente prefiere conectarse usando un token, primero necesitará un token de acceso:

1. En GitLab, navegue a [Tokens de acceso](https://gitlab.com/-/user_settings/personal_access_tokens) en la configuración de su Usuario y haga clic en **Agregar nuevo token.**<br>

   <figure><img src="https://3116332745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvrraExym8pNEUvBDoima%2Fuploads%2FlwsegMO7nKTi7EIU7kmY%2FGitlabToken.png?alt=media&#x26;token=777d3660-eaa4-4f92-b7cc-8ea23dae37c4" alt="" width="375"><figcaption></figcaption></figure>
2. Introduzca un **Nombre del token** y la **Fecha de caducidad** (típicamente un año desde la creación del token)**.**&#x20;
3. Bajo **Seleccione ámbitos**, selecciona `api` o `read_api` .
4. Haga clic en **Crear token,** luego copie el token que aparece.\ <br>

   <figure><img src="https://3116332745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvrraExym8pNEUvBDoima%2Fuploads%2F4lyLy4Ba0xmoIXD4VoCv%2FGitlabToken-Copy.png?alt=media&#x26;token=5340a12b-ffbd-4ba4-b546-d6ba941592cf" alt="" width="375"><figcaption></figcaption></figure>
5. De vuelta en Violet, vaya a Aplicaciones y seleccione <img src="https://3116332745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvrraExym8pNEUvBDoima%2Fuploads%2FcxfqrzhteuJZuB0cqVxw%2Fgitlab.png?alt=media&#x26;token=9e82b8c3-ed93-4706-91b1-974b7e3a3ca3" alt="" data-size="line"> **Gitlab**. Cree una nueva conexión y active **Mostrar otras opciones de autenticación**. Ingrese su token y haga clic en **Conectar con token API.**

<figure><img src="https://3116332745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvrraExym8pNEUvBDoima%2Fuploads%2Fz02H3AJNy7uGzVH3gsX8%2FVioletGitlabToken.png?alt=media&#x26;token=99b3875d-3712-4209-b43e-70838a2f2dc5" alt="" width="188"><figcaption></figcaption></figure>

6. Una vez conectado, configure su integración y luego haga clic **Crear.** ¡Listo!
