Create or Update client profile

Update Client profile

POST https://api.wolf.xyz/api/v1/companies/update_client_profile

Headers

Name
Type
Description

Authentication*

String

Authentication token of the current user.

Request Body

Name
Type
Description

client_form*

json

Form json with the id of the form and the array of fields. Each field being a json containing atleast three key value pairs: 'key', 'value', 'field_type'.

tenant*

String

Tenant key

company_id

String

optionally send company id if available

{
   "status": true, 
   "message": "Client updated successfully" // Response
}
//sample client_form
// return the form recieved from client profile

//Option 1: Send minimal JSON (Recommended)

{
  "id": 19,
  "fields": [
    {
      "key": 103,
      "value": "Google",
      "field_type": "Dropdown"
    },
    {
      "key": 80,
      "value": "New York City",
      "field_type": "Freetext",
    },
    {
      "key": 78,
      "value": null, //this field will not be saved due to being null. 
      "field_type": "Dropdown"
    },
    {
      "key": 82, // this field will not be saved since there is no value available. 
      "field_type": "File"
    }
  ]
}




// Option 2: Send full JSON


{
  "id": 19,
  "form_title": "Data from Clients",
  "form_description": "Please provide additional information about your company",
  "form_category": "standard",
  "custom_form_content": null,
  "slug": "data-from-clients",
  "fields": [
    {
      "key": 103,
      "value": 'Google',
      "label": "How did you hear about us?",
      "description": null,
      "type": "Select",
      "items": [
        {
          "label": "Social Media",
          "value": "Social Media"
        },
        {
          "label": " Google",
          "value": " Google"
        },
        {
          "label": " Referral",
          "value": " Referral"
        },
        {
          "label": " Word of Mouth",
          "value": " Word of Mouth"
        },
        {
          "label": " Other",
          "value": " Other"
        }
      ],
      "placeholder": "How did you hear about us?",
      "required": false,
      "id": 103,
      "subject": "How did you hear about us?",
      "field_type": "Dropdown",
      "options": [
        "Social Media",
        " Google",
        " Referral",
        " Word of Mouth",
        " Other"
      ],
      "country": 6
    },
    {
      "key": 80,
      "value": 'New York City',
      "label": "Where are your HQ located?",
      "description": null,
      "type": "Input",
      "items": null,
      "placeholder": "Where are your HQ located?",
      "required": false,
      "id": 80,
      "subject": "Where are your HQ located?",
      "field_type": "Freetext",
      "options": null,
      "country": 6
    },
    {
      "key": 78,
      "value": null, //this field will not be saved. 
      "label": "How many full time employees do you have?",
      "description": null,
      "type": "Select",
      "items": [
        {
          "label": "0-10",
          "value": "0-10"
        },
        {
          "label": " 11-30",
          "value": " 11-30"
        },
        {
          "label": " 31-50",
          "value": " 31-50"
        },
        {
          "label": " 51-100",
          "value": " 51-100"
        },
        {
          "label": " 101-200",
          "value": " 101-200"
        },
        {
          "label": " 201-500",
          "value": " 201-500"
        },
        {
          "label": " 501-1000",
          "value": " 501-1000"
        },
        {
          "label": " 1001-5000",
          "value": " 1001-5000"
        },
        {
          "label": " 5000+",
          "value": " 5000+"
        }
      ],
      "placeholder": "How many full time employees do you have?",
      "required": false,
      "id": 78,
      "subject": "How many full time employees do you have?",
      "field_type": "Dropdown",
      "options": [
        "0-10",
        " 11-30",
        " 31-50",
        " 51-100",
        " 101-200",
        " 201-500",
        " 501-1000",
        " 1001-5000",
        " 5000+"
      ],
      "country": 6
    },
    {
      "key": 82, // this field will not be saved. Since there is no value.
      "label": "Please upload a logo or photo of your facility",
      "description": null,
      "type": "File",
      "items": null,
      "placeholder": "Please upload a logo or photo of your facility",
      "required": false,
      "id": 82,
      "subject": "Please upload a logo or photo of your facility",
      "field_type": "File",
      "options": null,
      "country": 6
    }
  ]
}

Last updated

Was this helpful?