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":0}'};
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": 0 }'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.
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.
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. Required.
object
First match wins, in the order given. An empty list means the default rules in ADR 0009.
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" }}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" }}