v2

Swagger 2.02026-08-01331211921.0 KB
Source
Repositories

Get the root directory of the main branch

This endpoint redirects the client to the directory listing of the root directory on the main branch.

This is equivalent to directly hitting /2.0/repositories/{username}/{repo_slug}/src/{commit}/{path} without having to know the name or SHA1 of the repo's main branch.

To create new commits, POST to this endpoint

get/repositories/{workspace}/{repo_slug}/src

Query parameters

format'meta'

Instead of returning the file's contents, return the (json) meta data for it.

Response

If the path matches a file, then the raw contents of the file are returned (unless the format=meta query parameter was provided, in which case a json document containing the file's meta data is returned). If the path matches a directory, then a paginated list of file and directory entries is returned (if the format=meta query parameter was provided, then the json document containing the directory's meta data is returned).

sizeinteger

Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.

pageinteger

Page number of the current results. This is an optional element that is not provided in all responses.

pageleninteger

Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.

nextstring uri

Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.

previousstring uri

Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.