Skip to main content
POST
/
api
/
v1
/
request_schemas
Create
package main

import(
	"context"
	"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
            Oauth: "<YOUR_OAUTH_HERE>",
        }),
    )

    res, err := s.RequestSchema.Create(ctx, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.RequestSchemaServiceCreateResponse != nil {
        // handle response
    }
}
{
  "requestSchema": {
    "createdAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z",
    "form": {
      "description": "<string>",
      "displayName": "<string>",
      "fieldGroups": [
        {
          "default": true,
          "displayName": "<string>",
          "fields": [
            "<string>"
          ],
          "helpText": "<string>",
          "name": "<string>"
        }
      ],
      "fieldRelationships": [
        {
          "atLeastOne": {},
          "fieldNames": [
            "<string>"
          ],
          "mutuallyExclusive": {},
          "requiredTogether": {}
        }
      ],
      "fields": [
        {
          "adminConfig": {
            "defaultValueCel": "<string>",
            "showToUser": true
          },
          "boolField": {
            "checkboxField": {},
            "defaultValue": true,
            "rules": {
              "const": true
            },
            "toggleField": {}
          },
          "description": "<string>",
          "displayName": "<string>",
          "fileField": {
            "acceptedFileTypes": [
              "<string>"
            ],
            "fileInputField": {},
            "maxFileSize": "<string>"
          },
          "int64Field": {
            "defaultValue": "<string>",
            "numberField": {
              "maxValue": "<string>",
              "minValue": "<string>",
              "step": "<string>"
            },
            "placeholder": "<string>",
            "rules": {
              "const": "<string>",
              "gt": "<string>",
              "gte": "<string>",
              "ignoreEmpty": true,
              "in": [
                "<string>"
              ],
              "lt": "<string>",
              "lte": "<string>",
              "notIn": [
                "<string>"
              ]
            }
          },
          "name": "<string>",
          "oauth2Field": {
            "oauth2FieldView": {}
          },
          "sharedConfig": {
            "defaultValueCel": "<string>",
            "inputTransformationCel": "<string>",
            "lockDefaultValues": true
          },
          "stringField": {
            "defaultValue": "<string>",
            "passwordField": {},
            "pickerField": {
              "appUserPicker": {
                "appId": "<string>"
              },
              "resourcePicker": {
                "appId": "<string>",
                "resourceTypeId": "<string>"
              }
            },
            "placeholder": "<string>",
            "rules": {
              "address": true,
              "const": "<string>",
              "contains": "<string>",
              "email": true,
              "hostname": true,
              "ignoreEmpty": true,
              "in": [
                "<string>"
              ],
              "ip": true,
              "ipv4": true,
              "ipv6": true,
              "len": "<string>",
              "lenBytes": "<string>",
              "maxBytes": "<string>",
              "maxLen": "<string>",
              "minBytes": "<string>",
              "minLen": "<string>",
              "notContains": "<string>",
              "notIn": [
                "<string>"
              ],
              "pattern": "<string>",
              "prefix": "<string>",
              "strict": true,
              "suffix": "<string>",
              "uri": true,
              "uriRef": true,
              "uuid": true,
              "wellKnownRegex": "UNKNOWN"
            },
            "selectField": {
              "options": [
                {
                  "description": "<string>",
                  "displayName": "<string>",
                  "value": "<string>"
                }
              ],
              "type": "SELECT_TYPE_UNSPECIFIED"
            },
            "textField": {
              "multiline": true
            }
          },
          "stringSliceField": {
            "chipsField": {},
            "defaultValues": [
              "<string>"
            ],
            "pickerField": {
              "appUserPicker": {
                "appId": "<string>"
              },
              "resourcePicker": {
                "appId": "<string>",
                "resourceTypeId": "<string>"
              }
            },
            "placeholder": "<string>",
            "rules": {
              "ignoreEmpty": true,
              "items": {
                "any": {
                  "in": [
                    "<string>"
                  ],
                  "notIn": [
                    "<string>"
                  ],
                  "required": true
                },
                "bool": {
                  "const": true
                },
                "bytes": {
                  "const": "aSDinaTvuI8gbWludGxpZnk=",
                  "contains": "aSDinaTvuI8gbWludGxpZnk=",
                  "ignoreEmpty": true,
                  "in": [
                    "aSDinaTvuI8gbWludGxpZnk="
                  ],
                  "ip": true,
                  "ipv4": true,
                  "ipv6": true,
                  "len": "<string>",
                  "maxLen": "<string>",
                  "minLen": "<string>",
                  "notIn": [
                    "aSDinaTvuI8gbWludGxpZnk="
                  ],
                  "pattern": "<string>",
                  "prefix": "aSDinaTvuI8gbWludGxpZnk=",
                  "suffix": "aSDinaTvuI8gbWludGxpZnk="
                },
                "double": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "duration": {
                  "const": "<string>",
                  "gt": "<string>",
                  "gte": "<string>",
                  "in": [
                    "<string>"
                  ],
                  "lt": "<string>",
                  "lte": "<string>",
                  "notIn": [
                    "<string>"
                  ],
                  "required": true
                },
                "enum": {
                  "const": 123,
                  "definedOnly": true,
                  "in": [
                    123
                  ],
                  "notIn": [
                    123
                  ]
                },
                "fixed32": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "fixed64": {
                  "const": "<string>",
                  "gt": "<string>",
                  "gte": "<string>",
                  "ignoreEmpty": true,
                  "in": [
                    "<string>"
                  ],
                  "lt": "<string>",
                  "lte": "<string>",
                  "notIn": [
                    "<string>"
                  ]
                },
                "float": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "int32": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "int64": {
                  "const": "<string>",
                  "gt": "<string>",
                  "gte": "<string>",
                  "ignoreEmpty": true,
                  "in": [
                    "<string>"
                  ],
                  "lt": "<string>",
                  "lte": "<string>",
                  "notIn": [
                    "<string>"
                  ]
                },
                "map": {
                  "ignoreEmpty": true,
                  "keys": "<unknown>",
                  "maxPairs": "<string>",
                  "minPairs": "<string>",
                  "noSparse": true,
                  "values": "<unknown>"
                },
                "message": {
                  "required": true,
                  "skip": true
                },
                "repeated": "<unknown>",
                "sfixed32": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "sfixed64": {
                  "const": "<string>",
                  "gt": "<string>",
                  "gte": "<string>",
                  "ignoreEmpty": true,
                  "in": [
                    "<string>"
                  ],
                  "lt": "<string>",
                  "lte": "<string>",
                  "notIn": [
                    "<string>"
                  ]
                },
                "sint32": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "sint64": {
                  "const": "<string>",
                  "gt": "<string>",
                  "gte": "<string>",
                  "ignoreEmpty": true,
                  "in": [
                    "<string>"
                  ],
                  "lt": "<string>",
                  "lte": "<string>",
                  "notIn": [
                    "<string>"
                  ]
                },
                "string": {
                  "address": true,
                  "const": "<string>",
                  "contains": "<string>",
                  "email": true,
                  "hostname": true,
                  "ignoreEmpty": true,
                  "in": [
                    "<string>"
                  ],
                  "ip": true,
                  "ipv4": true,
                  "ipv6": true,
                  "len": "<string>",
                  "lenBytes": "<string>",
                  "maxBytes": "<string>",
                  "maxLen": "<string>",
                  "minBytes": "<string>",
                  "minLen": "<string>",
                  "notContains": "<string>",
                  "notIn": [
                    "<string>"
                  ],
                  "pattern": "<string>",
                  "prefix": "<string>",
                  "strict": true,
                  "suffix": "<string>",
                  "uri": true,
                  "uriRef": true,
                  "uuid": true,
                  "wellKnownRegex": "UNKNOWN"
                },
                "timestamp": {
                  "const": "2023-11-07T05:31:56Z",
                  "gt": "2023-11-07T05:31:56Z",
                  "gtNow": true,
                  "gte": "2023-11-07T05:31:56Z",
                  "lt": "2023-11-07T05:31:56Z",
                  "ltNow": true,
                  "lte": "2023-11-07T05:31:56Z",
                  "required": true,
                  "within": "<string>"
                },
                "uint32": {
                  "const": 123,
                  "gt": 123,
                  "gte": 123,
                  "ignoreEmpty": true,
                  "in": [
                    123
                  ],
                  "lt": 123,
                  "lte": 123,
                  "notIn": [
                    123
                  ]
                },
                "uint64": {
                  "const": "<string>",
                  "gt": "<string>",
                  "gte": "<string>",
                  "ignoreEmpty": true,
                  "in": [
                    "<string>"
                  ],
                  "lt": "<string>",
                  "lte": "<string>",
                  "notIn": [
                    "<string>"
                  ]
                }
              },
              "maxItems": "<string>",
              "minItems": "<string>",
              "unique": true
            }
          },
          "userConfig": {
            "inputTransformationCel": "<string>"
          }
        }
      ],
      "id": "<string>"
    },
    "id": "<string>",
    "justificationVisibility": "JUSTIFICATION_VISIBILITY_UNSPECIFIED",
    "modifiedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Authorization
string
header
required

This API uses OAuth2 with the Client Credential flow. Client Credentials must be sent in the BODY, not the headers. For an example of how to implement this, refer to the c1TokenSource.Token() function.

Body

application/json

The RequestSchemaServiceCreateRequest message.

description
string

The description field.

fields
Field · object[] | null

The fields field.

name
string

The name field.

Response

200 - application/json

Successful response

The RequestSchemaServiceCreateResponse message.

requestSchema
Request Schema · object

The RequestSchema message.