Approve a request as an endorsement
PUT
/api/v1/approvals/{id}/approve
const url = 'https://api.pkgplease.com/api/v1/approvals/example/approve';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"temporary":true,"justification":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.pkgplease.com/api/v1/approvals/example/approve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "temporary": true, "justification": "example" }'Writes or widens an entry in the org's org-endorsements pack through the same guarded write path used by POST .../packs/{slug}/entries, with the request's justification as the entry's reason — the next agent reads the decision instead of hitting an unexplained exception. If temporary is true, the approval itself expires in 24h. Approving never inserts a second, overlapping entry for a package the org already endorses: an existing entry's range is widened instead.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
temporary
boolean
justification
Becomes the endorsement entry's reason.
string
Examplegenerated
{ "temporary": true, "justification": "example"}Responses
Section titled “Responses”Approved
Approval not found
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}