Skip to content

Document and support the ATC REST API #1122

Open

Description

@vito

Update Nov 2025

(@taylorsilva): We're updating the website (Booklit to Zensical) and will add API docs after that migration.

Activity

  1. changed the title [-]Provide ATC (REST) API docs[/-] [+]Document and support the ATC REST API[/+] on Oct 2, 2017
  2. trobert2 commented on Apr 9, 2018

    @trobert2

    any progress on this issue?
    inb4 "nobody likes writing docs"

  3. scarytom commented on Oct 10, 2018

    @scarytom
  4. jama22 commented on Oct 26, 2018

    @jama22

    Whelp, I know its been a while but we're actually re-visiting this now. Since we originally wrote the issue, we've held off from doing this in favour of implementing Users and RBAC.

    We've finished both of those features now so we're starting to revisit what it will take to build up a sustainably maintained and documented API. As a first step, we're asking for feedback from any Concourse users who have written any scripts/apps/code against the existing Concourse API. If you have any feedback, please comment below!

  5. ifraixedes commented on Oct 29, 2018

    @ifraixedes

    An Open API document would be highly appreciated. It will allow knowing the request and response payloads on each route without having to dig into the Go source code.

    On the other hand (and probably in a second stage) some more source comments (GoDoc) would also be appreciated.

  6. murac commented on Nov 9, 2018

    @murac

    Even just for the time being, an example of fetching a Bearer token via script would be great. Anyone have any leads there?

  7. StevenArmstrong commented on Nov 9, 2018

    @StevenArmstrong
  8. dwelch2344 commented on Nov 16, 2018

    @dwelch2344

    Even starting with a postman collection or something would be awesome. TBO that’s my preferred docs these days

  9. dwelch2344 commented on Nov 16, 2018

    @dwelch2344

    It works like a charm. Syntax was a little hard to understand in the dogs when I first read through. Might open a PR for a little more clarity for newbies like me. Would that be received well? Either way, thanks for the awesome library!

  10. scarytom commented on Nov 19, 2018

    @scarytom

    Here is a bearer token request using curl

    curl -v \
    -X POST \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    --user 'fly:Zmx5' \
    --data-urlencode 'username=foo' \
    --data-urlencode 'password=bar' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=openid profile email federated:id groups' \
    'https://my-concourse.com/sky/token'

    EDIT: As @gkspranger points out below, from v6.7.2 the URL is /sky/issuer/token

  11. vergissberlin commented on Jan 17, 2019

    @vergissberlin

    An API documentation is created very easily with swagger. You can also generate code with it.

  12. 6 remaining items

  13. iornstein commented on Jun 18, 2019

    @iornstein

    @SvenDowideit (or anyone else) how do we add the authorization to requests like fetching the old config or PUT-ing new config for pipelines? I hit these end points and get 401. For example

    GET {{local-concourse-url}}/api/v1/teams/main/pipelines/hello-world/config

    Results in a 401. What is the authorization I am supposed to add? And how do I add it to the request? I tried the concourse user/password as Basic Auth params to the request and also tried adding headers username and password.

  14. fewknow commented on Jul 9, 2019

    @fewknow

    Fetching bearer token with basic auth(local)

    #!/bin/bash
    
    ## Variables required  #need to update these to take inputs for getting token per team and target.
    CONCOURSE_URL="http://concourseci.XXXXXX.XXX"
    CONCOURSE_USER="XXXX"
    CONCOURSE_PASSWORD="XXXX"
    CONCOURSE_TEAM="XXXXXX"
    CONCOURSE_TARGET=XXXXXX
    
    function get_token() {
      ## Create a file named token that will be used to read and write tokens
      touch token
    
      ## extract the LDAP authentication url and write to token file
      LOCAL_AUTH_URL=$CONCOURSE_URL$(curl -b token -c token -L "$CONCOURSE_URL/sky/login" -s | grep "/sky/issuer/auth/local?" | awk -F'"' '{print $4}')
      echo "url is $LOCAL_AUTH_URL"
      # login using username and password while writing to the token file
      curl -s -o /dev/null -b token -c token  -L --data-urlencode "login=$CONCOURSE_USER" --data-urlencode "password=$CONCOURSE_PASSWORD" "$LOCAL_AUTH_URL"
    
      ATC_BEARER_TOKEN=`grep 'Bearer' token | cut -d\   -f2 | sed 's/"$//'`
      echo $ATC_BEARER_TOKEN
    }
    

    Here is a link for LDAP : #1487

  15. TheDevMinerTV commented on Mar 14, 2020

    @TheDevMinerTV

    Bump

  16. aalfansuri commented on Oct 8, 2020

    @aalfansuri

    any further progress on this?

  17. kalrashubham49 commented on Nov 3, 2020

    @kalrashubham49

    Here is a bearer token request using curl

    curl -v \
    -X POST \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    --user 'fly:Zmx5' \
    --data-urlencode 'username=foo' \
    --data-urlencode 'password=bar' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=openid profile email federated:id groups' \
    'https://my-concourse.com/sky/token'

    It isn't working in my case , can you please verify does it still work in concourse 6.6.0

  18. kalrashubham49 commented on Nov 3, 2020

    @kalrashubham49

    Even just for the time being, an example of fetching a Bearer token via script would be great. Anyone have any leads there?

    Did you get the script for this ?

  19. scarytom commented on Nov 3, 2020

    @scarytom

    Here is a bearer token request using curl

    curl -v \
    -X POST \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    --user 'fly:Zmx5' \
    --data-urlencode 'username=foo' \
    --data-urlencode 'password=bar' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=openid profile email federated:id groups' \
    'https://my-concourse.com/sky/token'

    It isn't working in my case , can you please verify does it still work in concourse 6.6.0

    I have not verified this on any recent concourse versions, sorry.

  20. kalrashubham49 commented on Nov 4, 2020

    @kalrashubham49

    for those that come later - its also excellent to know that fly has a --verbose flag that will show you the HTTP request and responses that it makes - ie, the client is self documenting, the only hard thing is discovering that it does it :)

    --verbose              Print API requests and responses
    

    Is Verbose flag working ??

  21. micheelengronne commented on Nov 27, 2020

    @micheelengronne

    Nope. It shows the response but not the request.

  22. gkspranger commented on Jan 28, 2021

    @gkspranger

    @kalrashubham49 @micheelengronne

    the URL has changed in later versions -- don't know when exactly

    as of 6.7.2 -- it is /sky/issuer/token

    found it by searching here :: https://github.com/concourse/concourse/search?q=Zmx5

  23. jlamb1 commented on Jul 30, 2021

    @jlamb1

    @fewknow 's script worked great! In case anyone else makes the silly mistake I did, the --user 'fly:Zmx5' shouldn't be modified, but entered as is.

  24. fedoranvar commented on Nov 22, 2022

    @fedoranvar

    postman's way

    image

    image

  25. taylorsilva commented on Jan 6, 2025

    @taylorsilva
    Member

    Would still be nice to have. We should probably update the website since I think it's a bit hard for people to grok how to add things to it beyond basic text stuff.

  26. IvanChalukov commented on Nov 24, 2025

    @IvanChalukov
    Contributor

    Hi all - @Kump3r and I have prepared a draft of the Concourse API documentation in Markdown format. We hope it’s useful for anyone interested in working with or extending the ATC REST API. You can find the draft in the API Endpoint Quick Reference
    section in concourse-api-docs repo.

    @taylorsilva Since the official documentation is currently being migrated to MCdocs (as mentioned in the last cff working group meeting), we weren’t sure where contributions like this should live. Once the migration is complete, we’re happy to open a PR to integrate the API docs into the new structure.

    If you have a preferred location or any guidance on how you’d like this incorporated, just let us know - we’re glad to help.

  27. taylorsilva commented on Nov 24, 2025

    @taylorsilva
    Member

    I think having it sit in a separate repo is a good spot for now. Thanks for sharing what you've got so far!

    The website migration will be held off until we can migrate directly to zensical, which looks like it won't be too hard.

    Zensical mentions they'll have integrated support for mkdocstrings: https://zensical.org/compatibility/plugins/
    Which may make maintaining the API docs easier too!

    Either way, this repo looks great. Once we've migrated the site, we can do a PR of your repo's content into the concourse/docs repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions