# Create an Activation challenge

Generate a new activation code that can be delivered to endcustomer by the partner.

Endpoint: POST /v1/mfa/challenges/activation
Version: 1.0

## Query parameters:

  - `invalidate_existing_code` (boolean)
    When invalidate_existing_code=true, automatically invalidate existing code and return new code. Return 409 Conflict status, if an activation code for the given person already exists except when invalidate_existing_code=true

## Request fields (application/json):

  - `person_id` (string)
    ID of the person for whom the Activation challenge should be created.
    Example: "ec3d16cbc106f481b72d881d90c89cc5cper"

  - `origin` (string)
    A string to distinguish the origin of the request. The request can originate from MOBILE_APP or WEB or WEBUI and the values can be set as accordingly. It can be used to filter the list of codes while using the index endpoint.
    Example: "MOBILE_APP"

  - `purpose` (string)
    Purpose of the activation code to be created. The generated activation code can be used only for the desired purpose. More purposes may be supported in future.
    Example: "DEVICE_BINDING"

  - `delivery_method` (string)
    Method of delivering activation code to the endcustomer. SNAILMAIL is the only supported delivery_method as of now. More delivery_methods may be supported in the future.
    Example: "SNAILMAIL"

  - `invalidate_existing_code` (boolean)
    When invalidate_existing_code=true, automatically invalidate existing code and return new code. Return 409 Conflict status, if an activation code for the given person already exists except when invalidate_existing_code=true
    Example: true

## Response 201 fields (application/json):

  - `id` (string)
    The ID of the challenge.
    Example: "6642d15e-8f6b-4d28-9186-cdd61d80032a"

  - `person_id` (string)
    The ID of the person for whom the activation code is created
    Example: "55e47118b78741dbb81cdd3d372bc448cpar"

  - `code` (string)
    activation code
    Example: "code123456abcd"

  - `created_at` (string)
    The date and time when the code was created.
    Example: "2022-03-18T14:50:04Z"

  - `expires_at` (string)
    The date and time when the code will expire.
    Example: "2022-03-18T14:55:04Z"

  - `origin` (string)
    Origin of the request. Origin specifed while creating a new activation code is returned here. "SOLARISBANK" is a reserved origin value which will be used by Solaris SE for internally generated requests.
    Example: "MOBILE_APP"

  - `purpose` (string)
    Purpose of the activation_code.  The generated activation_code can be used only for the desired purpose. Currently the only supported purpose is DEVICE_BINDING. More purposes may be supported in future.
    Example: "DEVICE_BINDING"

  - `delivery_method` (string)
    Partner's method of delivering activation code to the endcustomer.
    Example: "SNAILMAIL"

  - `usage_count` (integer)
    The number of times the activation code has been used.
    Example: 1

  - `max_usage_count` (integer)
    The maximum number of times the activation code can be used.
    Example: 5

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID

## Response 409 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID

## Response 429 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID

## Response 500 fields (application/json):

  - `errors` (array)

  - `errors.id` (string, required)
    Correlation/Request ID

  - `errors.status` (integer, required)

  - `errors.code` (string, required)

  - `errors.title` (string, required)

  - `errors.detail` (string, required)

  - `errors.source` (object)

  - `errors.source.field` (string)

  - `errors.source.message` (string)

  - `errors.error_code` (string)
    Correlation/Request ID


