{
  "openapi": "3.0.3",
  "info": {
    "title": "Propello Cloud API",
    "description": "# Overview:\nThe Propello API has been created to allow organisations to interact with the Propello platform. There are a lot of different options available to integrators but we will aim to introduce these over the next few sections to help you get up and running quickly.\n<br><br>\nThe rate limit is set to 120 calls per minute, however this can be changed upon request. Please speak to your Customer Success Manager to arrange this. You can view your current rate limit in the CMS in the group settings under the “Integration” tab.\n<br><br>\nIf you have any questions around the integration or onboarding, please email [tech@propellocloud.com](mailto:tech@propellocloud.com)\n<br><br>\n| SDKs |\n|------|\n| [PHP](https://packagist.org/packages/propellocloud/propello-php-sdk) |\n| [JavaScript](https://www.npmjs.com/package/yourperx) |\n",
    "version": "3.0.0"
  },
  "tags": [
    {
      "name": "OAuth",
      "description": "OAuth Operations"
    },
    {
      "name": "User",
      "description": "User Operations"
    },
    {
      "name": "Group",
      "description": "Organisation Group Operations"
    },
    {
      "name": "Offer",
      "description": "Organisation Offer Operations"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "To authenticate requests, provide a Bearer token in the `Authorization` header. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`. You can obtain a token via the Authorise endpoint.\n"
      }
    },
    "schemas": {
      "OAuthBody": {
        "type": "object",
        "required": [
          "client_id",
          "client_secret",
          "grant_type",
          "scope"
        ],
        "properties": {
          "client_id": {
            "type": "integer",
            "example": 1
          },
          "client_secret": {
            "type": "string",
            "example": "VFCcW5gYwy4RDn9hhK16DoPK6nrqvNkIPoeeyMnG"
          },
          "grant_type": {
            "type": "string",
            "example": "client_credentials"
          },
          "scope": {
            "type": "string",
            "example": "*"
          }
        }
      },
      "GetUserBody": {
        "type": "object",
        "properties": {
          "organisation_group_id": {
            "type": "integer",
            "example": 1
          }
        }
      },
      "GetLoginBody": {
        "type": "object",
        "properties": {
          "organisation_group_id": {
            "type": "integer",
            "example": 1
          }
        }
      },
      "CreateUserBody": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "organisation_group_id": {
            "type": "integer",
            "example": 1
          },
          "email": {
            "type": "string",
            "example": "john.smith@example.org"
          },
          "first_name": {
            "type": "string",
            "example": "John"
          },
          "last_name": {
            "type": "string",
            "example": "Smith"
          },
          "company_name": {
            "type": "string",
            "example": "Parisian Inc"
          },
          "UID": {
            "type": "string",
            "example": "ABC123"
          },
          "meta": {
            "type": "object",
            "properties": {
              "sales": {
                "type": "integer",
                "example": 5
              },
              "location": {
                "type": "string",
                "example": "London"
              }
            }
          }
        }
      },
      "CreateUserLoginURLBody": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "organisation_group_id": {
            "type": "integer",
            "example": 1
          },
          "email": {
            "type": "string",
            "example": "john.smith@example.org"
          },
          "first_name": {
            "type": "string",
            "example": "John"
          },
          "last_name": {
            "type": "string",
            "example": "Smith"
          },
          "company_name": {
            "type": "string",
            "example": "Parisian Inc"
          },
          "UID": {
            "type": "string",
            "example": "ABC123"
          },
          "meta": {
            "type": "object",
            "properties": {
              "sales": {
                "type": "integer",
                "example": 5
              },
              "location": {
                "type": "string",
                "example": "London"
              }
            }
          },
          "return_user_details": {
            "type": "boolean",
            "default": false,
            "description": "Return the created users details. Only applicable for login url."
          }
        }
      },
      "BulkCreateUserBody": {
        "type": "object",
        "properties": {
          "send_activation_email": {
            "type": "boolean",
            "example": false
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateUserBody"
            }
          }
        }
      },
      "OAuthResponse": {
        "type": "object",
        "properties": {
          "token_type": {
            "type": "string",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "example": 31536000
          },
          "access_token": {
            "type": "string",
            "example": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzMjIiLCJqdGkiOiI1MTY4ZTZkNzlhNjcyZDViZmM2ODAzZDI4MWI4NmNiNzQ1NDhkY2QzMjQ3MWI2OTM4MDhlYTNhOGFmZjU3ZGU0MmU2MDliNDkxNGRlNzM0ZCIsImlhdCI6MTczNDM0MTk2NS41MDcxMTYsIm5iZiI6MTczNDM0MTk2NS41MDcxMjEsImV4cCI6MTc2NTg3Nzk2NS4zODcxNzEsInN1YiI6IiIsInNjb3BlcyI6WyIqIl19.Q-2atcKqCsd41nqH96yCOoaz8uhrauE3tdi0MhIcVNXvTjjBIytn7LTd3g4s-GLp3WejdJnLDnabszexafA6PKlVVHZUbN2SjQMBXzm9NKI9hB4LWtLvMcmiCyod4V6m0pZC5UeF3VQHkaMz1nPOfnbfI2rf5dzED6aGB7TkN_XjgqzhGwQObyRPbtVFdl7ceUZL5rDsDEOWvDj85KRoczuJSGFAWHnPCHJXLxP6UjwNoXn1AeJ8snHwvlHHZwfXWDPBXqGrm5OYsL7Mw_B8qCCuOQbofVRaN1Yur8XxNjMejflbAnIM5tgpjmCjUhxBiWfTYi4PfCUM4UrXVLDqDmCWlqMwrTmn34jbbGxJ50D4T7eSEMjfxbzhKthrfSV3FpY5oZm8AuRKmla2diniAfrLSocgDARyOCT-blI6bG_E54YPOop1EucEVRkh2AlgMjpwOJwREBp-zfPG7SPmryiH4wcUl_2g4JUzytQxImMklECkLpruurgLTzqkRVjJW2kKwNEtccsB6YaLtD31Scf3jplXUdFoomPzKixe4x98bpvJS2sVRSIzvuJhBh9nooRrXNTFyUJzo417tFHNnFOt_a6ib23AxJ8v363SP0Eq0ql4WUSDQeM93SyPF-e-8gBrfOFZHh8C3PZr90zRacffI8bop4oUu6NgH4ia4nE"
          }
        }
      },
      "GetEmptyResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "example": []
          }
        }
      },
      "GetAcceptedResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 202
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "example": []
          }
        }
      },
      "GetLoginResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "login_url": {
                "type": "string",
                "example": "https://example.yourperx.com/auth-token/BkfEhiym5mvKYSrAp5iQ0YnRTB9mdo3r9kLXe6EuEhTPoAONLNIJ8TNzGerJVwgX"
              }
            }
          }
        }
      },
      "GetLoginCreateUserResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "login_url": {
                "type": "string",
                "example": "https://example.yourperx.com/auth-token/BkfEhiym5mvKYSrAp5iQ0YnRTB9mdo3r9kLXe6EuEhTPoAONLNIJ8TNzGerJVwgX"
              },
              "user": {
                "type": "object",
                "description": "Only applicable if return_user_details:true is passed in the payload",
                "properties": {
                  "id": {
                    "type": "integer",
                    "example": 987654
                  },
                  "UID": {
                    "type": "string",
                    "example": "ABC123"
                  },
                  "first_name": {
                    "type": "string",
                    "example": "John"
                  },
                  "last_name": {
                    "type": "string",
                    "example": "Smith"
                  },
                  "email": {
                    "type": "string",
                    "example": "john.smith@example.org"
                  },
                  "status": {
                    "type": "string",
                    "example": "Active"
                  },
                  "created_at": {
                    "type": "string",
                    "example": "1970-01-30T00:00:00.000000Z"
                  }
                }
              }
            }
          }
        }
      },
      "GetUserResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "example": 987654
              },
              "UID": {
                "type": "string",
                "example": "ABC123"
              },
              "first_name": {
                "type": "string",
                "example": "John"
              },
              "last_name": {
                "type": "string",
                "example": "Smith"
              },
              "email": {
                "type": "string",
                "example": "john.smith@example.org"
              },
              "status": {
                "type": "string",
                "example": "Active"
              },
              "created_at": {
                "type": "string",
                "example": "1970-01-30T00:00:00.000000Z"
              }
            }
          }
        }
      },
      "GetUserListResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "example": 987654
                },
                "UID": {
                  "type": "string",
                  "example": "test"
                },
                "alt_uid": {
                  "type": "string",
                  "example": "test"
                },
                "first_name": {
                  "type": "string",
                  "example": "John"
                },
                "last_name": {
                  "type": "string",
                  "example": "Smith"
                },
                "email": {
                  "type": "string",
                  "example": "john.smith@example.org"
                },
                "status": {
                  "type": "string",
                  "example": "Active"
                },
                "last_login": {
                  "type": "string",
                  "example": "1970-01-30T00:00:00.000000Z"
                },
                "login_count": {
                  "type": "integer",
                  "example": 0
                },
                "created_at": {
                  "type": "string",
                  "example": "1970-01-30T00:00:00.000000Z"
                },
                "updated_at": {
                  "type": "string",
                  "example": "1970-01-30T00:00:00.000000Z"
                },
                "deleted_at": {
                  "type": "string",
                  "example": "1970-01-30T00:00:00.000000Z"
                }
              }
            }
          }
        }
      },
      "AnonymiseUserBody": {
        "type": "object",
        "properties": {
          "maintain_uid": {
            "type": "boolean",
            "default": true,
            "example": true
          }
        }
      },
      "MakeKnownUserBody": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "example": "john.smith@example.org"
          },
          "UID": {
            "type": "string",
            "example": "ABC123"
          },
          "first_name": {
            "type": "string",
            "example": "John"
          },
          "last_name": {
            "type": "string",
            "example": "Smith"
          },
          "company_name": {
            "type": "string",
            "example": "Smith Co Ltd."
          },
          "billing_phone": {
            "type": "string",
            "example": "+441234567890"
          },
          "billing_email": {
            "type": "string",
            "example": "accounts@example.org"
          },
          "billing_address_line_1": {
            "type": "string",
            "example": "123 Example Road"
          },
          "billing_address_line_2": {
            "type": "string",
            "example": "City District"
          },
          "billing_postcode": {
            "type": "string",
            "example": "EX4 4PL"
          },
          "billing_county": {
            "type": "string",
            "example": "Lancashire"
          },
          "billing_country": {
            "type": "string",
            "example": "United Kingdom"
          },
          "get_login": {
            "type": "boolean",
            "example": true
          }
        }
      },
      "MakeKnownUserResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "example": 987654
              },
              "UID": {
                "type": "string",
                "example": "ABC123"
              },
              "first_name": {
                "type": "string",
                "example": "John"
              },
              "last_name": {
                "type": "string",
                "example": "Smith"
              },
              "email": {
                "type": "string",
                "example": "john.smith@example.org"
              },
              "created_at": {
                "type": "string",
                "example": "1970-01-30T00:00:00.000000Z"
              },
              "login_url": {
                "type": "string",
                "example": "https://example.yourperx.com/auth-token/BkfEhiym5mvKYSrAp5iQ0YnRTB9mdo3r9kLXe6EuEhTPoAONLNIJ8TNzGerJVwgX"
              }
            }
          }
        }
      },
      "GetAnonymisedUserResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "example": 987654
              },
              "UID": {
                "type": "string",
                "example": "ABC123"
              },
              "first_name": {
                "type": "string",
                "example": null
              },
              "last_name": {
                "type": "string",
                "example": null
              },
              "email": {
                "type": "string",
                "example": null
              },
              "created_at": {
                "type": "string",
                "example": "1970-01-30T00:00:00.000000Z"
              }
            }
          }
        }
      },
      "GetGroupResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "example": 1
              },
              "name": {
                "type": "string",
                "example": "example_org"
              },
              "display_name": {
                "type": "string",
                "example": "Example Org. LTD"
              },
              "sandbox": {
                "type": "boolean",
                "example": 0
              },
              "locale": {
                "type": "string",
                "example": "en_GB"
              },
              "timezone": {
                "type": "string",
                "example": "Europe/London"
              },
              "custom_domain": {
                "type": "string",
                "example": null
              },
              "subdomain": {
                "type": "string",
                "example": "example"
              }
            }
          }
        }
      },
      "GetGroupsResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "example": [
              {
                "id": 1,
                "name": "example_org",
                "display_name": "Example Org. LTD",
                "sandbox": 0,
                "locale": "en_GB",
                "timezone": "Europe/London",
                "custom_domain": null,
                "subdomain": "example"
              },
              {
                "id": 2,
                "name": "example_org_sandbox",
                "display_name": "Sandbox Example Org. LTD",
                "sandbox": 1,
                "locale": "en_GB",
                "timezone": "Europe/London",
                "custom_domain": null,
                "subdomain": "example-sandbox"
              }
            ]
          }
        }
      },
      "GetOfferResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "example": 1
              },
              "partner_id": {
                "type": "integer",
                "example": 1
              },
              "title": {
                "type": "string",
                "example": "Offer example - get amount off."
              },
              "overview": {
                "type": "string",
                "example": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
              },
              "terms": {
                "type": "string",
                "example": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
              },
              "faq": {
                "type": "string",
                "example": "<p>FAQ: Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
              },
              "how_to_redeem": {
                "type": "string",
                "example": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
              },
              "offer": {
                "type": "string",
                "example": "Save amount"
              },
              "redemption_in_store": {
                "type": "boolean",
                "example": false
              },
              "redemption_online": {
                "type": "boolean",
                "example": true
              },
              "redemption_selected_stores": {
                "type": "boolean",
                "example": true
              },
              "image": {
                "type": "string",
                "example": "https://example.yourperx.com/storage/perx/15/151521222306.jpg"
              },
              "offer_link": {
                "type": "string",
                "example": "https://example.yourperx.com/perk/1"
              }
            }
          }
        }
      },
      "GetOfferListResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "example": "1970-01-30T00:00:00.000000Z"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "example": 987654
                },
                "brand": {
                  "type": "string",
                  "example": "Example"
                },
                "brand_id": {
                  "type": "integer",
                  "example": 987654
                },
                "title": {
                  "type": "string",
                  "example": "Smith"
                },
                "overview": {
                  "type": "string",
                  "example": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
                },
                "terms": {
                  "type": "string",
                  "example": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
                },
                "faq": {
                  "type": "string",
                  "example": "<p>FAQ: Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
                },
                "how_to_redeem": {
                  "type": "string",
                  "example": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n</p>"
                },
                "offer": {
                  "type": "string",
                  "example": "Save amount"
                },
                "start_date": {
                  "type": "string",
                  "example": "1970-01-30T00:00:00.000000Z"
                },
                "end_date": {
                  "type": "string",
                  "example": "1970-01-30T00:00:00.000000Z"
                },
                "redemption_in_store": {
                  "type": "boolean",
                  "example": false
                },
                "redemption_online": {
                  "type": "boolean",
                  "example": true
                },
                "redemption_selected_stores": {
                  "type": "boolean",
                  "example": true
                },
                "link": {
                  "type": "string",
                  "example": "https://example.yourperx.com/perk/1"
                },
                "image": {
                  "type": "string",
                  "example": "https://example.yourperx.com/storage/perx/15/151521222306.jpg"
                },
                "discount": {
                  "type": "integer",
                  "example": 0
                },
                "type": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "example": 987654
                    },
                    "perk_id": {
                      "type": "integer",
                      "example": 987654
                    },
                    "voucher_code": {
                      "type": "string",
                      "example": "sxbgd4354"
                    },
                    "presentation": {
                      "type": "string",
                      "example": "text"
                    },
                    "redeem_url_protocol": {
                      "type": "string",
                      "example": "https"
                    },
                    "redeem_url": {
                      "type": "string",
                      "example": "https://example.com/storage/perx/15/151521222306.jpg"
                    },
                    "trackable": {
                      "type": "boolean",
                      "example": 1
                    },
                    "redeem_from_inventory": {
                      "type": "boolean",
                      "example": false
                    },
                    "group_allocated_inventory": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                },
                "perk_type_format": {
                  "type": "string",
                  "example": "Smith"
                }
              }
            }
          },
          "current_page": {
            "type": "integer",
            "example": 1
          },
          "first_page_url": {
            "type": "string",
            "example": "https://{url}/v3/offers/list?page=2"
          },
          "last_page_url": {
            "type": "string",
            "example": "https://{url}/v3/offers/list?page=15"
          },
          "next_page_url": {
            "type": "string",
            "example": "https://{url}/v3/offers/list?page=3"
          },
          "prev_page_url": {
            "type": "string",
            "example": "https://{url}/v3/offers/list?page=1"
          },
          "from": {
            "type": "integer",
            "example": 4
          },
          "last_page": {
            "type": "integer",
            "example": 15
          },
          "path": {
            "type": "string",
            "example": "https://{url}/v3/offers/list"
          },
          "per_page": {
            "type": "integer",
            "example": 3
          },
          "to": {
            "type": "integer",
            "example": 6
          },
          "total": {
            "type": "integer",
            "example": 45
          }
        }
      }
    },
    "requestBodies": {
      "OAuthBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthBody"
            }
          }
        },
        "description": "Our API uses a client based OAuth method for authenticating. Firstly you’ll need to request an access token using your client id and secret. This token then will have to be passed in the headers for all requests.",
        "required": true
      },
      "GetUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetUserBody"
            }
          }
        },
        "description": "If accessing via an organisation level token you will need to provide an organisation group id in order to indicate which group the user belongs to.",
        "required": false
      },
      "GetLoginURLRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetLoginBody"
            }
          }
        },
        "description": "It may be necessary to redirect a user to our platform and automatically authenticate them. Using this endpoint your system can receive a URL which will authenticate the user.\n<br><br>\nIf accessing via an organisation level token you will need to provide an organisation group id in order to indicate which group the user belongs to.\n",
        "required": false
      },
      "DeleteUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetUserBody"
            }
          }
        },
        "description": "Deleting a user, revokes their access to the platform but retains all information stored against them.\n<br><br>\nWe suggest implementing a process to reactivate users if there is potential that they may return. If a request to create a user that already exists in either an active or deleted state is posted to our system, we will reject it.\n<br><br>\nIf accessing via an organisation level token you will need to provide an organisation group id in order to indicate which group the user belongs to.\n",
        "required": false
      },
      "GetGroupIdRequest": {
        "description": "If accessing via an organisation level token you will need to provide an organisation group id in order to indicate which group you are requesting.",
        "required": false,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetUserBody"
            }
          }
        }
      },
      "GetEmptyRequest": {
        "content": {
          "application/json": {
            "schema": {
              "example": {}
            }
          }
        }
      },
      "CreateUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateUserBody"
            }
          }
        },
        "description": "When deciding on your implementation consider if there is potential for a user’s email to change. By default we do not allow users added via API to change their email address, making your system the single point of truth for these changes. Also consider how our platform will be updated with email changes.\n<br><br>\n`company_name` should only be used if you would like to refer to your user as their company name, generally because your database does not hold a `first_name` & `last_name`.\n<br><br>\n#### **Metadata**\nAdditional metadata can be configured within the platform by a member of the Propello team, and updated by API. Metadata can be used to segment users in the platform for a number of reasons including reporting and targeted campaigns.\n<br><br>\n#### **Welcome email & SMS**\nThe group settings allow you to configure sending a new user added via the API an instant activation email and/or SMS with a tokenised URL to set their password. Once set, if you want to override this include either of the following variables in your request.\n<br><br>\n##### **Email**\n`\"send_activation_email\": true|false`\n<br><br>\n##### **SMS**\n`\"send_activation_sms\": true|false`\n<br><br>\nIf the send_activation_sms flag is set to true you need to provide a \"phone\" attribute in your request.\n"
      },
      "BulkCreateUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BulkCreateUserBody"
            }
          }
        },
        "description": "When deciding on your implementation consider if there is potential for a user’s email to change. By default we do not allow users added via API to change their email address, making your system the single point of truth for these changes. Also consider how our platform will be updated with email changes.\n<br><br>\n`company_name` should only be used if you would like to refer to your user as their company name, generally because your database does not hold a `first_name` & `last_name`.\n<br><br>\n#### **Metadata**\nAdditional metadata can be configured within the platform by a member of the Propello team, and updated by API. Metadata can be used to segment users in the platform for a number of reasons including reporting and targeted campaigns.\n<br><br>\n#### **Welcome email**\nThe group settings allow you to configure sending a new user added via the API an instant activation email and/or SMS with a tokenised URL to set their password. Once set, if you want to override this include either of the following variables in your request.\n<br><br>\n##### **Email**\n`\"send_activation_email\": true|false`\n"
      },
      "CreateUserLoginRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateUserLoginURLBody"
            }
          }
        },
        "description": "If you need to create a user and automatically generate a login URL.\n<br><br>\nIf accessing via an organisation level token you will need to provide an `organisation_group_id` in order to indicate which group the user belongs to.\n"
      },
      "UpdateUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateUserBody"
            }
          }
        },
        "description": "If accessing via an organisation level token you will need to provide an `organisation_group_id` in order to indicate which group the user belongs to."
      },
      "AnonymiseUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AnonymiseUserBody"
            }
          }
        },
        "description": "By default the users UID will be maintained, if you wish to remove this you will need to pass a `maintain_uid` of `false`. Please note, if you anonymise the UID you will need to retain the record ID returned if the user is to be restored at a later date.\n<br><br>\nIf accessing via an organisation level token you will need to provide an `organisation_group_id` in order to indicate which group the user belongs to.\n"
      },
      "MakeKnownUserRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MakeKnownUserBody"
            }
          }
        },
        "description": "If you wish to obtain a login url for the user when restoring, you can send a `get_login` value of `true` and a `login_url` value will be appended to the response.\n<br><br>\nIf accessing via an organisation level token you will need to provide an `organisation_group_id` in order to indicate which group the user belongs to.\n"
      }
    }
  },
  "paths": {
    "/v3/oauth/token": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Generate Access Tokens",
        "operationId": "OAuth-Request",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/OAuthBody"
        }
      }
    },
    "/v3/user/create": {
      "post": {
        "tags": [
          "User"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "create-user",
        "summary": "Create a new user record",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/create/bulk": {
      "post": {
        "tags": [
          "User"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "bulk-create-user",
        "summary": "Bulk create new user records (limit 100)",
        "requestBody": {
          "$ref": "#/components/requestBodies/BulkCreateUserRequest"
        },
        "responses": {
          "202": {
            "description": "ACCEPTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/get/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "email",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "email",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "john.smith@example.org",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Retrieve a users details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "get-user-detail",
        "requestBody": {
          "$ref": "#/components/requestBodies/GetUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/list": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Retrieve a list of users",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "get-user-list",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/update/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "email",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "email",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "john.smith@example.org",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "User"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "update-user",
        "summary": "Update a user record",
        "requestBody": {
          "$ref": "#/components/requestBodies/UpdateUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/delete/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "email",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "email",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "john.smith@example.org",
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "tags": [
          "User"
        ],
        "summary": "Deactivate a user record",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "delete-user",
        "requestBody": {
          "$ref": "#/components/requestBodies/DeleteUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEmptyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/restore/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "email",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "email",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "john.smith@example.org",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Restore a deactivated user record",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "restore-user",
        "requestBody": {
          "$ref": "#/components/requestBodies/GetUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEmptyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/login-url/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "email",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "email",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "john.smith@example.org",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Generate a single-use user login link",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "login-url",
        "requestBody": {
          "$ref": "#/components/requestBodies/GetLoginURLRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetLoginResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/create/login-url": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Create a user and return a single-use login URL",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "create-login-url",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateUserLoginRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetLoginCreateUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/anonymise/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "email",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "email",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "john.smith@example.org",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Delete user and remove identifiable information",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "anonymise-user",
        "requestBody": {
          "$ref": "#/components/requestBodies/AnonymiseUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAnonymisedUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/user/make-known/{identifier}/{identifier_value}": {
      "parameters": [
        {
          "in": "path",
          "name": "identifier",
          "required": true,
          "example": "UID",
          "schema": {
            "type": "string",
            "enum": [
              "id",
              "UID"
            ]
          }
        },
        {
          "in": "path",
          "name": "identifier_value",
          "required": true,
          "example": "ABC1234",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Restore previously anonymised user",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "make-known-user",
        "requestBody": {
          "$ref": "#/components/requestBodies/MakeKnownUserRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MakeKnownUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/group": {
      "post": {
        "tags": [
          "Group"
        ],
        "summary": "Get Group Details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "get-group",
        "requestBody": {
          "$ref": "#/components/requestBodies/GetGroupIdRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/group/list": {
      "post": {
        "tags": [
          "Group"
        ],
        "summary": "Get Groups List",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "get-group-list",
        "requestBody": {
          "$ref": "#/components/requestBodies/GetEmptyRequest"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/offers/{id}": {
      "post": {
        "tags": [
          "Offer"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer",
              "example": 1
            }
          }
        ],
        "summary": "Get Offer Details",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "get-offer",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOfferResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    },
    "/v3/offers/list": {
      "post": {
        "tags": [
          "Offer"
        ],
        "summary": "Get Offer List",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "operationId": "get-offer-list",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOfferListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated"
          },
          "405": {
            "description": "The specified method for the request is invalid."
          }
        }
      }
    }
  }
}