Create a new enrollment Access Token for the Entity

POST /v2/Services/{ServiceSid}/AccessTokens

Create a new enrollment Access Token for the Entity

Path parameters

  • ServiceSid string Required

    The unique SID identifier of the Service.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VA[0-9a-fA-F]{32}$.

application/x-www-form-urlencoded

Body

  • Identity string Required

    The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID.

  • FactorType string Required

    The Type of the Factor. Currently only push is supported.

    Value is push.

  • FactorFriendlyName string

    The friendly name of the factor that is going to be created with this access token

  • Ttl integer

    How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

      A 34 character string that uniquely identifies this Access Token.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^YK[0-9a-fA-F]{32}$.

    • account_sid string | null

      The unique SID identifier of the Account.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • service_sid string | null

      The unique SID identifier of the Verify Service.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VA[0-9a-fA-F]{32}$.

    • entity_identity string | null

      The unique external identifier for the Entity of the Service.

    • factor_type string

      The Type of the Factor. Currently only push is supported.

      Value is push.

    • factor_friendly_name string | null

      A human readable description of this factor, up to 64 characters. For a push factor, this can be the device's name.

    • token string | null

      The access token generated for enrollment, this is an encrypted json web token.

    • url string(uri) | null

      The URL of this resource.

    • ttl integer

      How long, in seconds, the access token is valid. Max: 5 minutes

      Default value is 0.

    • date_created string(date-time) | null

      The date that this access token was created, given in ISO 8601 format.

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

      A 34 character string that uniquely identifies this Access Token.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^YK[0-9a-fA-F]{32}$.

    • account_sid string | null

      The unique SID identifier of the Account.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • service_sid string | null

      The unique SID identifier of the Verify Service.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VA[0-9a-fA-F]{32}$.

    • entity_identity string | null

      The unique external identifier for the Entity of the Service.

    • factor_type string

      The Type of the Factor. Currently only push is supported.

      Value is push.

    • factor_friendly_name string | null

      A human readable description of this factor, up to 64 characters. For a push factor, this can be the device's name.

    • token string | null

      The access token generated for enrollment, this is an encrypted json web token.

    • url string(uri) | null

      The URL of this resource.

    • ttl integer

      How long, in seconds, the access token is valid. Max: 5 minutes

      Default value is 0.

    • date_created string(date-time) | null

      The date that this access token was created, given in ISO 8601 format.

POST /v2/Services/{ServiceSid}/AccessTokens
curl \
 --request POST 'https://verify.twilio.com/v2/Services/{ServiceSid}/AccessTokens' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Ttl=300&Identity=ff483d1ff591898a9942916050d2ca3f&FactorType=push&FactorFriendlyName=John+Doe+iPhone'
{"Ttl"=>300, "Identity"=>"ff483d1ff591898a9942916050d2ca3f", "FactorType"=>"push", "FactorFriendlyName"=>"John Doe iPhone"}
{"Ttl"=>300, "Identity"=>"ff483d1ff591898a9942916050d2ca3f", "FactorType"=>"push", "FactorFriendlyName"=>"John Doe iPhone"}
{"Identity"=>"ff483d1ff591898a9942916050d2ca3f", "FactorType"=>"push", "FactorFriendlyName"=>"John Doe iPhone"}
Response examples (200)
{
  "sid": "YKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ttl": 300,
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AccessTokens/YKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "token": "eyJ6aXAiOiJERUYiLCJraWQiOiJTQVNfUzNfX19LTVNfdjEiLCJjdHkiOiJ0d2lsaW8tZnBhO3Y9MSIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJkaXIifQ..qjltWfIgQaTwp2De.81Z_6W4kR-hdlAUvJQCbwS8CQ7QAoFRkOvNMoySEj8zEB4BAY3MXhPARfaK4Lnr4YceA2cXEmrzPKQ7bPm0XZMGYm1fqLYzAR8YAqUetI9WEdQLFytg1h4XnJnXhgd99eNXsLkpKHhsCnFkchV9eGpRrdrfB0STR5Xq0fdakomb98iuIFt1XtP0_iqxvxQZKe1O4035XhK_ELVwQBz_qdI77XRZBFM0REAzlnEOe61nOcQxkaIM9Qel9L7RPhcndcCPFAyYjxo6Ri5c4vOnszLDiHmeK9Ep9fRE5-Oz0px0ZEg_FgTUEPFPo2OHQj076H1plJnFr-qPINDJkUL_i7loqG1IlapOi1JSlflPH-Ebj4hhpBdMIcs-OX7jhqzmVqkIKWkpPyPEmfvY2-eA5Zpoo08YpqAJ3G1l_xEcHl28Ijkefj1mdb6E8POx41skAwXCpdfIbzWzV_VjFpmwhacS3JZNt9C4hVG4Yp-RGPEl1C7aJHRIUavAmoRHaXbfG20zzv5Zu0P5PcopDszzoqVfZpzc.GCt35DWTurtP-QaIL5aBSQ",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "factor_type": "push",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2015-07-30T20:00:00Z",
  "entity_identity": "ff483d1ff591898a9942916050d2ca3f",
  "factor_friendly_name": "John Doe iPhone"
}
Response examples (201)
{
  "sid": "YKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ttl": 300,
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AccessTokens/YKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "token": "eyJ6aXAiOiJERUYiLCJraWQiOiJTQVNfUzNfX19LTVNfdjEiLCJjdHkiOiJ0d2lsaW8tZnBhO3Y9MSIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJkaXIifQ..qjltWfIgQaTwp2De.81Z_6W4kR-hdlAUvJQCbwS8CQ7QAoFRkOvNMoySEj8zEB4BAY3MXhPARfaK4Lnr4YceA2cXEmrzPKQ7bPm0XZMGYm1fqLYzAR8YAqUetI9WEdQLFytg1h4XnJnXhgd99eNXsLkpKHhsCnFkchV9eGpRrdrfB0STR5Xq0fdakomb98iuIFt1XtP0_iqxvxQZKe1O4035XhK_ELVwQBz_qdI77XRZBFM0REAzlnEOe61nOcQxkaIM9Qel9L7RPhcndcCPFAyYjxo6Ri5c4vOnszLDiHmeK9Ep9fRE5-Oz0px0ZEg_FgTUEPFPo2OHQj076H1plJnFr-qPINDJkUL_i7loqG1IlapOi1JSlflPH-Ebj4hhpBdMIcs-OX7jhqzmVqkIKWkpPyPEmfvY2-eA5Zpoo08YpqAJ3G1l_xEcHl28Ijkefj1mdb6E8POx41skAwXCpdfIbzWzV_VjFpmwhacS3JZNt9C4hVG4Yp-RGPEl1C7aJHRIUavAmoRHaXbfG20zzv5Zu0P5PcopDszzoqVfZpzc.GCt35DWTurtP-QaIL5aBSQ",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "factor_type": "push",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2015-07-30T20:00:00Z",
  "entity_identity": "ff483d1ff591898a9942916050d2ca3f",
  "factor_friendly_name": "John Doe iPhone"
}
{
  "sid": "YKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ttl": 60,
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AccessTokens/YKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "token": "eyJ6aXAiOiJERUYiLCJraWQiOiJTQVNfUzNfX19LTVNfdjEiLCJjdHkiOiJ0d2lsaW8tZnBhO3Y9MSIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJkaXIifQ..qjltWfIgQaTwp2De.81Z_6W4kR-hdlAUvJQCbwS8CQ7QAoFRkOvNMoySEj8zEB4BAY3MXhPARfaK4Lnr4YceA2cXEmrzPKQ7bPm0XZMGYm1fqLYzAR8YAqUetI9WEdQLFytg1h4XnJnXhgd99eNXsLkpKHhsCnFkchV9eGpRrdrfB0STR5Xq0fdakomb98iuIFt1XtP0_iqxvxQZKe1O4035XhK_ELVwQBz_qdI77XRZBFM0REAzlnEOe61nOcQxkaIM9Qel9L7RPhcndcCPFAyYjxo6Ri5c4vOnszLDiHmeK9Ep9fRE5-Oz0px0ZEg_FgTUEPFPo2OHQj076H1plJnFr-qPINDJkUL_i7loqG1IlapOi1JSlflPH-Ebj4hhpBdMIcs-OX7jhqzmVqkIKWkpPyPEmfvY2-eA5Zpoo08YpqAJ3G1l_xEcHl28Ijkefj1mdb6E8POx41skAwXCpdfIbzWzV_VjFpmwhacS3JZNt9C4hVG4Yp-RGPEl1C7aJHRIUavAmoRHaXbfG20zzv5Zu0P5PcopDszzoqVfZpzc.GCt35DWTurtP-QaIL5aBSQ",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "factor_type": "push",
  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2015-07-30T20:00:00Z",
  "entity_identity": "ff483d1ff591898a9942916050d2ca3f",
  "factor_friendly_name": "John Doe iPhone"
}