# EndUserType resource

## EndUserType Properties

```json
{"type":"object","refName":"trusthub.v1.end_user_type","modelName":"trusthub_v1_end_user_type","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^OY[0-9a-fA-F]{32}$","nullable":true,"description":"The unique string that identifies the End-User Type resource."},"friendly_name":{"type":"string","nullable":true,"description":"A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc"},"machine_name":{"type":"string","nullable":true,"description":"A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc."},"fields":{"type":"array","nullable":true,"description":"The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals."},"url":{"type":"string","format":"uri","nullable":true,"description":"The absolute URL of the End-User Type resource."}}}
```

## Fetch a specific End-User Type Instance.

`GET https://trusthub.twilio.com/v1/EndUserTypes/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The unique string that identifies the End-User Type resource.","schema":{"type":"string"},"required":true}]
```

Fetch an EndUserType

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchEndUserType() {
  const endUserType = await client.trusthub.v1.endUserTypes("Sid").fetch();

  console.log(endUserType.sid);
}

fetchEndUserType();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

end_user_type = client.trusthub.v1.end_user_types("Sid").fetch()

print(end_user_type.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Trusthub.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var endUserType = await EndUserTypeResource.FetchAsync(pathSid: "Sid");

        Console.WriteLine(endUserType.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.trusthub.v1.EndUserType;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        EndUserType endUserType = EndUserType.fetcher("Sid").fetch();

        System.out.println(endUserType.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.TrusthubV1.FetchEndUserType("Sid")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$end_user_type = $twilio->trusthub->v1->endUserTypes("Sid")->fetch();

print $end_user_type->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

end_user_type = @client
                .trusthub
                .v1
                .end_user_types('Sid')
                .fetch

puts end_user_type.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:trusthub:v1:end-user-types:fetch \
   --sid Sid
```

```bash
curl -X GET "https://trusthub.twilio.com/v1/EndUserTypes/Sid" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "url": "https://trusthub.twilio.com/v1/EndUserTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "fields": [
    {
      "machine_name": "last_name",
      "friendly_name": "Last Name",
      "constraint": "String"
    },
    {
      "machine_name": "email",
      "friendly_name": "Email",
      "constraint": "String"
    },
    {
      "machine_name": "first_name",
      "friendly_name": "First Name",
      "constraint": "String"
    },
    {
      "machine_name": "business_title",
      "friendly_name": "Business Title",
      "constraint": "String"
    },
    {
      "machine_name": "phone_number",
      "friendly_name": "Phone Number",
      "constraint": "String"
    },
    {
      "machine_name": "job_position",
      "friendly_name": "Job Position",
      "constraint": "String"
    }
  ],
  "machine_name": "authorized_representative_1",
  "friendly_name": "Authorized Representative one",
  "sid": "Sid"
}
```

## Retrieve a list of all End-User Types.

`GET https://trusthub.twilio.com/v1/EndUserTypes`

### Query parameters

```json
[{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

List multiple EndUserTypes

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listEndUserType() {
  const endUserTypes = await client.trusthub.v1.endUserTypes.list({
    limit: 20,
  });

  endUserTypes.forEach((e) => console.log(e.sid));
}

listEndUserType();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

end_user_types = client.trusthub.v1.end_user_types.list(limit=20)

for record in end_user_types:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Trusthub.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var endUserTypes = await EndUserTypeResource.ReadAsync(limit: 20);

        foreach (var record in endUserTypes) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.trusthub.v1.EndUserType;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<EndUserType> endUserTypes = EndUserType.reader().limit(20).read();

        for (EndUserType record : endUserTypes) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	trusthub "github.com/twilio/twilio-go/rest/trusthub/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &trusthub.ListEndUserTypeParams{}
	params.SetLimit(20)

	resp, err := client.TrusthubV1.ListEndUserType(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$endUserTypes = $twilio->trusthub->v1->endUserTypes->read(20);

foreach ($endUserTypes as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

end_user_types = @client
                 .trusthub
                 .v1
                 .end_user_types
                 .list(limit: 20)

end_user_types.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:trusthub:v1:end-user-types:list
```

```bash
curl -X GET "https://trusthub.twilio.com/v1/EndUserTypes?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "end_user_types": [],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://trusthub.twilio.com/v1/EndUserTypes?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://trusthub.twilio.com/v1/EndUserTypes?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "end_user_types"
  }
}
```
