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

# Create an Ip

> Create a new IP object.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/sip-connections.yml post /ips
openapi: 3.1.0
info:
  title: Telnyx SIP Connections API
  version: 2.0.0
  description: API for SIP connections.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ips:
    post:
      tags:
        - IPs
      summary: Create an Ip
      description: Create a new IP object.
      operationId: CreateIp
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIpRequest'
      responses:
        '201':
          $ref: '#/components/responses/IpResponse'
        '401':
          $ref: '#/components/responses/UnauthenticatedResponse'
        '403':
          $ref: '#/components/responses/connections_UnauthorizedResponse'
        '422':
          $ref: '#/components/responses/connections_UnprocessableEntityResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const ip = await client.ips.create({ ip_address: '192.168.0.0' });

            console.log(ip.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            ip = client.ips.create(
                ip_address="192.168.0.0",
            )
            print(ip.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tip, err := client.IPs.New(context.TODO(), telnyx.IPNewParams{\n\t\tIPAddress: \"192.168.0.0\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", ip.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.ips.IpCreateParams;
            import com.telnyx.sdk.models.ips.IpCreateResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    IpCreateParams params = IpCreateParams.builder()
                        .ipAddress("192.168.0.0")
                        .build();
                    IpCreateResponse ip = client.ips().create(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            ip = telnyx.ips.create(ip_address: "192.168.0.0")

            puts(ip)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $ip = $client->ips->create(
                ipAddress: '192.168.0.0',
                connectionID: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
                port: 5060,
              );

              var_dump($ip);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ips create \
              --api-key 'My API Key' \
              --ip-address 192.168.0.0
components:
  schemas:
    CreateIpRequest:
      title: Create Ip Request
      type: object
      required:
        - ip_address
      properties:
        connection_id:
          type: string
          description: ID of the IP Connection to which this IP should be attached.
        ip_address:
          type: string
          description: IP adddress represented by this resource.
          example: 192.168.0.0
        port:
          type: integer
          description: Port to use when connecting to this IP.
          default: 5060
          example: 5060
      example:
        connection_id: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        ip_address: 192.168.0.0
        port: 5060
    Ip:
      type: object
      title: Ip
      properties:
        id:
          type: string
          description: Identifies the type of resource.
          example: '1293384261075731499'
          x-format: int64
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: ip
        connection_id:
          type: string
          description: ID of the IP Connection to which this IP should be attached.
        ip_address:
          type: string
          description: IP adddress represented by this resource.
          example: 192.168.0.0
        port:
          type: integer
          description: Port to use when connecting to this IP.
          default: 5060
          example: 5060
        created_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2018-02-02T22:25:27.521Z'
      example:
        id: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        record_type: ip
        connection_id: '3456789987654'
        ip_address: 192.168.0.0
        port: 5060
        created_at: '2018-02-02T22:25:27.521Z'
        updated_at: '2018-02-02T22:25:27.521Z'
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              detail:
                type: string
              meta:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
              title:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
  responses:
    IpResponse:
      description: Successful response with details about an IP.
      content:
        application/json:
          schema:
            type: object
            title: Ip Response
            properties:
              data:
                $ref: '#/components/schemas/Ip'
    UnauthenticatedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Authentication Failed:
              value:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not understand the provided credentials.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
    connections_UnauthorizedResponse:
      description: >-
        The user doesn't have the required permissions to perform the requested
        action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            notAuthorized:
              value:
                errors:
                  - code: '10010'
                    title: Not authorized
                    detail: You are not authorized to access the requested resource.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10010
                    source:
                      pointer: /
    connections_UnprocessableEntityResponse:
      description: >-
        The request was well-formed but was unable to be followed due to
        semantic errors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unprocessableEntity:
              value:
                errors:
                  - code: '10015'
                    title: Bad Request
                    detail: >-
                      Invalid dnis_format: test, was provided. Acceptable
                      formats are +e164, e164, national, sip_username
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10015
                    source:
                      pointer: /inbound/dnis_number_format
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````