Create a request type
const url = 'https://api.pealboard.com/v1/portals/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/request-types';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","form":[{"key":"example","label":"example","type":"text","required":false,"options":["example"],"helpText":"example"}],"destination":{"repositoryId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","labels":[],"projectNodeId":"example","initialFieldValues":{},"issueType":"example"},"statusMap":[],"position":1}'};
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://api.pealboard.com/v1/portals/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/request-types \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "form": [ { "key": "example", "label": "example", "type": "text", "required": false, "options": [ "example" ], "helpText": "example" } ], "destination": { "repositoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "labels": [], "projectNodeId": "example", "initialFieldValues": {}, "issueType": "example" }, "statusMap": [], "position": 1 }'The form is what a customer fills in; the destination is where the issue goes. statusMap overrides the default status rules for requests of this type — leave it empty to use the defaults, which cover closed, project Status and the needs-info label.
destination.repositoryId is optional. Omitted, it is the portal’s default repository, and then the workspace’s. The repository is resolved once, here, and stored on the request type: changing a default later does not move a request type that was already created.
Access. Requires the admin role or above (admin, owner). A request type decides which repository a stranger’s submission lands in, which is a decision about the workspace’s GitHub account. API-key scope: portals:write.
Billing. Refused with 402 while the workspace’s billing has lapsed. Reads continue and nothing is deleted.
Retries. Send Idempotency-Key and a retry with the same key within 24 hours returns the first answer rather than acting twice.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”From GET /v1/portals.
From GET /v1/portals.
Request Body
Section titled “Request Body”object
object
The key a submission sends this field’s value under.
The heading this field becomes in the issue body.
Text is one line and textarea is many. select needs options; every other type ignores them.
object
Where the issue is created. Omit it, or send null, and the portal’s default repository is used, and then the workspace’s; a request type with neither is refused with 422. The repository is resolved when the request type is saved and stored on it, so a request type already created keeps the repository it has whatever the defaults change to. On PATCH, null asks for that resolution again, now.
object
First match wins, in the order given. An empty list means the default rules in ADR 0009.
Where in the chooser this request type is offered. Omitted, it goes last: one more than the highest position the portal already has.
Responses
Section titled “Responses”The request type.
object
A UUID this API issued.
A UUID this API issued.
object
The key a submission sends this field’s value under.
The heading this field becomes in the issue body.
Text is one line and textarea is many. select needs options; every other type ignores them.
object
A UUID this API issued.
object
First match wins, in the order given. An empty list means the default rules in ADR 0009.
Example
{ "form": [ { "type": "text", "required": false } ], "statusMap": [ { "when": { "kind": "closed", "stateReason": "completed" }, "status": "Open" } ]}No valid credentials.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The workspace’s billing has lapsed, so writes are refused.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}Authenticated, but not permitted.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}No such resource, or it is not visible to you.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The request conflicts with the current state.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The request did not match the expected shape.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}Rate limited. Retry after the interval in the header.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}GitHub or another dependency refused or did not answer. Nothing in the workspace changed.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}