gitpublish module route (requires gitpublish:pull_request:write)
POST
/v1/m/gitpublish/targets/{id}/pull-requests
const url = 'https://example.com/v1/m/gitpublish/targets/example/pull-requests';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"acknowledge_intent":"example","base":"example","body":"example","commit":"example","draft":true,"head_ref":"example","operation_id":"example","title":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/m/gitpublish/targets/example/pull-requests \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "acknowledge_intent": "example", "base": "example", "body": "example", "commit": "example", "draft": true, "head_ref": "example", "operation_id": "example", "title": "example" }'Opens a pull request from a branch under the target’s push prefix into an allowed merge base, or adopts the matching open one, and returns the publication intent with its receipt.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” id
required
string
Path parameter id.
Header Parameters
Section titled “ Header Parameters ” X-Olivares-Tenant
string format: uuid
Target tenant id; required when the principal can act in more than one tenant.
Request Body required
Section titled “ Request Body required ”The handler decodes one strict JSON document, bounded at 1 MiB; an unknown field is field_not_accepted.
Media type application/json
object
acknowledge_intent
string
base
required
An allowed merge base.
string
body
string
commit
required
The requested head commit, recorded beside the observed one.
string
draft
boolean
head_ref
required
Source branch under push_prefix; the host binds branches, not SHAs.
string
operation_id
required
Client idempotency key.
string
title
required
string
Example generated
{ "acknowledge_intent": "example", "base": "example", "body": "example", "commit": "example", "draft": true, "head_ref": "example", "operation_id": "example", "title": "example"}Responses
Section titled “ Responses ”OK
Media type application/json
object
Example generated
{}Bad request
Media type application/json
object
Example generated
{}Unauthenticated
Media type application/json
object
Example generated
{}Forbidden
Media type application/json
object
Example generated
{}Not found
Media type application/json
object
Example generated
{}Conflict / setup required
Media type application/json
object
Example generated
{}Rate limited
Media type application/json
object
Example generated
{}