Skip to content

Get a commit

GET
/api/v1/sites/{site}/commits/{sha}
curl --request GET \
--url https://digize.com/api/v1/sites/example/commits/example \
--header 'x-api-key: <x-api-key>'

One commit in a Worker’s git repo and what it changed against its first parent: each file’s status, lines added and removed, and diff. Diffs come for the first 50 files; pass path for one file’s alone. Null if there’s no such commit.

Needs the sites:read permission.

site
required
string
>= 1 characters <= 64 characters
sha
required

The commit’s id, or a branch or tag.

string
>= 1 characters <= 255 characters /^\S+$/
path

Only this file’s change.

string
<= 4096 characters

Only this file’s change.

Done

Media typeapplication/json
Any of:
object
commit
required
object
sha
required
string
title
required
string
message
required
string
author
required
object
name
required
string
email
required
string
committer
required
object
name
required
string
email
required
string
authoredAt
required
string format: date-time
committedAt
required
string format: date-time
parents
required
Array<string>
files
required
Array<object>
object
path
required
string
previousPath
required
string | null
status
required
string
Allowed values: added modified deleted renamed
additions
required
number
deletions
required
number
hunks
required
Any of:
Array<object>
object
oldStart
required
number
oldLines
required
number
newStart
required
number
newLines
required
number
lines
required

Each line after its mark: a space for an unchanged line, + added, - removed, and \ for no newline at the end.

Array<string>
omitted
required
Any of:
string
Allowed values: binary large limit
truncated
required

It changes more files than are listed.

boolean

Example

{
"files": [
{
"status": "added",
"omitted": "binary"
}
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}