Skip to content

Create a request type

POST
/v1/portals/{portalId}/request-types
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.

portalId
required

From GET /v1/portals.

string format: uuid

From GET /v1/portals.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 80 characters
description
string | null
<= 500 characters
form
Array<object>
<= 30 items
object
key
required

The key a submission sends this field’s value under.

string
>= 1 characters <= 60 characters /^[a-z0-9_]+$/
label
required

The heading this field becomes in the issue body.

string
>= 1 characters <= 120 characters
type
required

Text is one line and textarea is many. select needs options; every other type ignores them.

string
Allowed values: text textarea select checkbox email url number date
required
boolean
options
Array<string>
<= 50 items
helpText
string
<= 300 characters
destination
required
object
repositoryId
required

Where the issue is created. Required.

string format: uuid
labels
Array<string>
default: <= 20 items
projectNodeId
string | null
>= 1 characters
initialFieldValues
object
key
additional properties
issueType
string | null
>= 1 characters
statusMap
Array<object>
default: <= 30 items

First match wins, in the order given. An empty list means the default rules in ADR 0009.

object
when
required
One of:
object
kind
required
string
Allowed values: closed
stateReason
required
string | null
Allowed values: completed not_planned duplicate
status
required

The customer-facing word. Seven, fixed, and never GitHub’s own vocabulary.

string
Allowed values: Open Planned In progress Waiting on you Completed Merged Closed
position
integer
0 <= 999

The request type.

Media typeapplication/json
object
id
required

A UUID this API issued.

string format: uuid
portalId
required

A UUID this API issued.

string format: uuid
name
required
string
description
required
string | null
form
required
Array<object>
object
key
required

The key a submission sends this field’s value under.

string
>= 1 characters <= 60 characters /^[a-z0-9_]+$/
label
required

The heading this field becomes in the issue body.

string
>= 1 characters <= 120 characters
type
required

Text is one line and textarea is many. select needs options; every other type ignores them.

string
Allowed values: text textarea select checkbox email url number date
required
boolean
options
Array<string>
<= 50 items
helpText
string
<= 300 characters
destination
required
object
repositoryId
required

A UUID this API issued.

string format: uuid
repositoryFullName
required
string
labels
required
Array<string>
projectNodeId
required
string | null
initialFieldValues
required
object
key
additional properties
issueType
required
string | null
statusMap
required
Array<object>

First match wins, in the order given. An empty list means the default rules in ADR 0009.

object
when
required
One of:
object
kind
required
string
Allowed values: closed
stateReason
required
string | null
Allowed values: completed not_planned duplicate
status
required

The customer-facing word. Seven, fixed, and never GitHub’s own vocabulary.

string
Allowed values: Open Planned In progress Waiting on you Completed Merged Closed
position
required
integer
createdAt
required
string format: date-time
Example
{
"form": [
{
"type": "text",
"required": false
}
],
"statusMap": [
{
"when": {
"kind": "closed",
"stateReason": "completed"
},
"status": "Open"
}
]
}

No valid credentials.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

Authenticated, but not permitted.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

No such resource, or it is not visible to you.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

The request conflicts with the current state.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

The request did not match the expected shape.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

Rate limited. Retry after the interval in the header.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
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.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}