> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Address Book Entry

> Creates an entry for a portfolio's trusted addresses.

Use the Prime SDK or CLI to test this endpoint by following the [quickstart](/prime/introduction/quickstart) guide and running with the following examples

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    AddressBookService addressBookService = PrimeServiceFactory.createAddressBookService(client);

    CreateAddressBookEntryRequest request = new CreateAddressBookEntryRequest.Builder("portfolio_id")
            .accountIdentifier("account_identifier")
            .address("address")
            .currencySymbol("currency_symbol")
            .name("name")
            .build();

    CreateAddressBookEntryResponse response = addressBookService.createAddressBookEntry(request);
    ```

    For more information, please visit the [Prime Java SDK](https://github.com/coinbase-samples/prime-sdk-java).
  </Tab>

  <Tab title=".NET">
    ```csharp wrap theme={null}
    var addressBookService = new AddressBookService(client);

    var request = new CreateAddressBookEntryRequest("portfolio_id")
    {
        Address = "address",
        CurrencySymbol = "currency_symbol",
        Name = "name",
        AccountIdentifier = "account_identifier",
    };

    var response = addressBookService.CreateAddressBookEntry(request);
    ```

    For more information, please visit the [Prime .NET SDK](https://github.com/coinbase-samples/prime-sdk-dotnet).
  </Tab>

  <Tab title="Go">
    ```go wrap theme={null}
    addressBookService := addressbook.NewAddressBookService(client)

    request := &addressbook.CreateAddressBookEntryRequest{
        PortfolioId: "portfolio-id",
        Address: "address",
        Symbol: "currency_symbol",
        Name: "name",
        AccountIdentifier: "account_identifier",
    }

    response, err := addressBookService.CreateAddressBookEntry(context.Background(), request)
    ```

    For more information, please visit the [Prime Go SDK](https://github.com/coinbase-samples/prime-sdk-go).
  </Tab>

  <Tab title="Python">
    ```python wrap theme={null}
    prime_client = PrimeClient(credentials)

    request = CreateAddressBookEntryRequest(
        portfolio_id="portfolio_id",
        address="address",
        currency_symbol="currency_symbol",
        name="name",
        account_identifier="account_identifier",
    )

    response = prime_client.get_address_book(request)
    ```

    For more information, please visit the [Prime Python SDK](https://github.com/coinbase-samples/prime-sdk-py).
  </Tab>

  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl create-address-book-entry --help
    ```

    For more information, please visit the [Prime CLI](https://github.com/coinbase-samples/prime-cli).
  </Tab>

  <Tab title="TS/JS">
    ```typescript wrap theme={null}
    const addressBooksService = new AddressBooksService(client);

    addressBooksService.createAddressBook({
        portfolioId: 'PORTFOLIO_ID_HERE',
        address: 'ADDRESS_HERE',
        currencySymbol: 'ETH',
        name: 'XYZ Address',
    }).then(async (response) => {
        console.log('Address Book: ', response);
    })
    ```

    For more information, please visit the [Prime TS SDK](https://github.com/coinbase-samples/prime-sdk-ts).
  </Tab>
</Tabs>


## OpenAPI

````yaml POST /v1/portfolios/{portfolio_id}/address_book
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/portfolios/{portfolio_id}/address_book:
    post:
      tags:
        - Address Book
      summary: Create Address Book Entry
      description: Creates an entry for a portfolio's trusted addresses.
      operationId: PrimeRESTAPI_CreatePortfolioAddressBookEntry
      parameters:
        - name: portfolio_id
          in: path
          description: Portfolio ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              required:
                - address
                - currency_symbol
                - name
              type: object
              properties:
                address:
                  type: string
                  description: Crypto address to add
                currency_symbol:
                  type: string
                  description: Currency symbol of address to add
                name:
                  type: string
                  description: Name of address book entry
                account_identifier:
                  type: string
                  description: Account Identifier (memo/destination tag)
                chain_ids:
                  type: array
                  description: >-
                    List of compatible chain IDs for the address, empty for
                    Solana
                  items:
                    type: string
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryResponse
components:
  schemas:
    coinbase.public_rest_api.CreatePortfolioAddressBookEntryResponse:
      required:
        - activity_id
        - activity_type
        - num_approvals_remaining
      type: object
      properties:
        activity_type:
          $ref: '#/components/schemas/coinbase.custody.api.ActivityType'
        num_approvals_remaining:
          type: integer
          format: int32
        activity_id:
          type: string
    coinbase.custody.api.ActivityType:
      title: >-
        - ACTIVITY_TYPE_WITHDRAWAL: PrimeActivityService Custody ActivityTypes
        that will replace the above
      type: string
      enum:
        - ACTIVITY_TYPE_GOVERNANCE_VOTE
        - ACTIVITY_TYPE_INVITATION
        - ACTIVITY_TYPE_WALLET_CHANGE
        - ACTIVITY_TYPE_API_KEY_CHANGE
        - ACTIVITY_TYPE_SETTINGS_CHANGE
        - ACTIVITY_TYPE_BILLING_PREFERENCE_CHANGE
        - ACTIVITY_TYPE_PAYMENT_METHOD_CHANGE
        - ACTIVITY_TYPE_WITHDRAWAL
        - ACTIVITY_TYPE_DEPOSIT
        - ACTIVITY_TYPE_CREATE_WALLET
        - ACTIVITY_TYPE_REMOVE_WALLET
        - ACTIVITY_TYPE_UPDATE_WALLET
        - ACTIVITY_TYPE_CAST_VOTE
        - ACTIVITY_TYPE_ENABLE_VOTING
        - ACTIVITY_TYPE_STAKE
        - ACTIVITY_TYPE_UNSTAKE
        - ACTIVITY_TYPE_CHANGE_VALIDATOR
        - ACTIVITY_TYPE_RESTAKE
        - ACTIVITY_TYPE_ADDRESS_BOOK
        - ACTIVITY_TYPE_TEAM_MEMBERS
        - ACTIVITY_TYPE_BILLING
        - ACTIVITY_TYPE_SECURITY
        - ACTIVITY_TYPE_API
        - ACTIVITY_TYPE_SETTINGS
        - ACTIVITY_TYPE_SMART_CONTRACT
        - ACTIVITY_TYPE_USER_CHANGE_REQUEST_NO_PAS
        - ACTIVITY_TYPE_WEB3_TRANSACTION
        - ACTIVITY_TYPE_WEB3_MESSAGE
        - ACTIVITY_TYPE_CLAIM_REWARDS

````