Skip to main content

Create a secret for a repository

POST 

http://localhost:8080/api/v1/repositories/:repositoryId/secrets

Create a secret for a repository

Request

Path Parameters

    repositoryId int64required

    The repository's ID.

Body

    descriptionString (null,string)nullable
    nameString (string)required
    valueString (string)required

Responses

Success

Response Headers
    Schema
      descriptionString (null,string)nullable
      nameString (string)required

    Authorization: oauth2

    name: tokentype: oauth2flows: {
      "authorizationCode": {
        "authorizationUrl": "http://localhost:8081/realms/master/protocol/openid-connect/auth",
        "tokenUrl": "http://localhost:8081/realms/master/protocol/openid-connect/token",
        "scopes": {}
      }
    }
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost:8080/api/v1/repositories/:repositoryId/secrets");
    request.Headers.Add("Accept", "application/json");
    request.Headers.Add("Authorization", "Bearer <token>");
    var content = new StringContent("{\n \"name\": \"string\",\n \"value\": \"string\"\n}", null, "application/json");
    request.Content = content;
    var response = await client.SendAsync(request);
    response.EnsureSuccessStatusCode();
    Console.WriteLine(await response.Content.ReadAsStringAsync());
    Request Collapse all
    Base URL
    http://localhost:8080
    Auth
    Parameters
    — pathrequired
    Body
    {
      "name": "string",
      "value": "string"
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!