Company Fields

Here you can manage via API the fields data collected from your visitors

The Field Object

Attribute

Description

*id string required

The id of the field. Text and Dropdown field id is used to save the data under customFields in the visit object.

*type string required

The type of the field. It can be one value of: [Phone, Email, Address, CPF, RG, Document, Company, Position, Sector, Text, Dropdown]

name string

The label displayed to the visitor. It's required if the type is Text or Dropdown

required bool

It indicates if the field is required or not. Default false

sort number

The order that this field will be visible to the visitor. Default: it will be added to the end

options [string]

An array of strings that is only used when the type is Dropdown

Endpoints

get
Get Fields

https://api.w3lcome.com/v1/company/fields
This endpoint allows you to get the company fields
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Basic token
Response
200: OK
Success
{
"fields": [
{
"id": "LcKjSsT1",
"type": "Email",
"name": "Email",
"required": true,
"sort": 0
}, {
"id": "dI8GcykL",
"type": "Text",
"name": "Favorite sound",
"required": false,
"sort": 1
}, {
"id": "bffep3ZVa",
"type": "Dropdown",
"name": "Gender",
"required": false,
"sort": 2
"options": ["Male", "Female"]
}
]
}
500: Internal Server Error
Error
{
"type": "INTERNAL"
}

post
Post Field

https://api.w3lcome.com/v1/company/fields
Create a new field
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Basic token
Body Parameters
id
optional
string
If not provided will be automatically generated
type
required
string
The type of the field. See the list above
name
optional
string
The label name displayed to the visitor. Required when the type is Text or Dropdown
required
optional
boolean
Whether the field is required or not
sort
optional
number
It has to be a number greater than 0. If not provided it will be added to the end of the fields list
options
optional
array
An array of string. Required if the type is Dropdown
Response
200: OK
Success
{
"field": {
"id": "uniqueId",
"type": "Phone",
"name": "Your phone number",
"required": true,
"sort": 0
}
}
400: Bad Request
Error
{
"type": "INVALID_TYPE"
}

patch
Update a field

https://api.w3lcome.com/v1/company/fields/:id
Update a field
Request
Response
Request
Path Parameters
id
required
string
The field id
Headers
Content-Type
required
string
application/json
Authorization
required
string
Basic token
Body Parameters
type
optional
string
The type of the field
name
optional
string
The label name displayed to the visitor. Required when the type is Text or Dropdown
required
optional
boolean
Whether the field is required or not
sort
optional
number
It has to be a number greater than 0. If not provided it will be added to the end of the fields list
options
optional
array
An array of string. Required if the type is Dropdown
Response
200: OK
Success
{
"field": {
"id": "uniqueId",
"type": "Phone",
"name": "Your BEST phone number",
"required": true,
"sort": 0
}
}
404: Not Found
Error
{
"type": "NOT_FOUND"
}

delete
Delete a field

https://api.w3lcome.com/v1/company/fields/:id
Delete a field
Request
Response
Request
Path Parameters
id
required
string
The field id
Headers
Content-Type
required
string
application/json
Authorization
required
string
Basic token
Response
200: OK
Success
{
"field": {
"id": "uniqueId",
"type": "Phone",
"name": "Your BEST phone number",
"required": true,
"sort": 0
}
}
404: Not Found
Error
{
"type": "NOT_FOUND"
}

Table of errors

Method

Type

GET PATCH DELETE

NOT_FOUND

PATCH POST

INVALID_TYPE

PATCH POST

MISSING_OPTIONS

POST

MISSING_NAME

POST

FIELD_ID_ALREADY_EXISTS

POST

TYPE_ALREADY_USED

GET PATCH POST DELETE

INTERNAL