> ## 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.

# Validate SIM cards registration codes

> It validates whether SIM card registration codes are valid or not.



## OpenAPI

````yaml /openapi/source/external/wireless/wireless.json post /sim_cards/actions/validate_registration_codes
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API.
security:
  - bearerAuth: []
tags:
  - name: Wireless
    description: Wireless operations
  - name: SIM Cards
    description: SIM Cards operations
  - name: SIM Card Actions
    description: >-
      View SIM card actions, their progress and timestamps using the SIM Card
      Actions API
  - name: SIM Card Groups
    description: SIM Card Groups operations
  - name: SIM Card Group Actions
    description: SIM Card Group actions operations
  - name: SIM Card Orders
    description: SIM Card Orders operations
  - name: Reporting
    description: Wireless reporting operations
  - name: Wireless Regions
    description: Regions for wireless services
  - name: OTA updates
    description: OTA updates operations
  - name: Mobile Network Operators
    description: Mobile network operators operations
  - name: Private Wireless Gateways
    description: Private Wireless Gateways operations
  - name: Wireless Blocklists
    description: Wireless Blocklists operations
  - name: Traffic Policy Profiles
    description: Traffic Policy Profiles operations
paths:
  /sim_cards/actions/validate_registration_codes:
    post:
      tags:
        - SIM Cards
      summary: Validate SIM cards registration codes
      description: It validates whether SIM card registration codes are valid or not.
      operationId: ValidateRegistrationCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                registration_codes:
                  type: array
                  items:
                    type: string
              description: The object containing the Array of SIM card registration codes.
              example:
                registration_codes:
                  - '123456780'
                  - '1231231230'
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SIMCardRegistrationCodeValidations'
        '401':
          description: Unauthorized
        default:
          $ref: '#/components/responses/GenericErrorResponse'
      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 response = await
            client.simCards.actions.validateRegistrationCodes();


            console.log(response.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
            )
            response = client.sim_cards.actions.validate_registration_codes()
            print(response.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\tresponse, err := client.SimCards.Actions.ValidateRegistrationCodes(context.TODO(), telnyx.SimCardActionValidateRegistrationCodesParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.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.simcards.actions.ActionValidateRegistrationCodesParams;

            import
            com.telnyx.sdk.models.simcards.actions.ActionValidateRegistrationCodesResponse;


            public final class Main {
                private Main() {}

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

                    ActionValidateRegistrationCodesResponse response = client.simCards().actions().validateRegistrationCodes();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.sim_cards.actions.validate_registration_codes

            puts(response)
        - 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 {
              $response = $client->simCards->actions->validateRegistrationCodes(
                registrationCodes: ['123456780', '1231231230']
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx sim-cards:actions validate-registration-codes \
              --api-key 'My API Key'
components:
  schemas:
    SIMCardRegistrationCodeValidations:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SIMCardRegistrationCodeValidation'
    SIMCardRegistrationCodeValidation:
      type: object
      properties:
        record_type:
          type: string
          example: sim_card_registration_code_validation
        registration_code:
          type: string
          description: The 10-digit SIM card registration code
          example: '0123456789'
        valid:
          type: boolean
          description: The attribute that denotes whether the code is valid or not
          example: false
        invalid_detail:
          type:
            - string
            - 'null'
          description: The validation message
          example: This code has already been used.
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  responses:
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          examples:
            unexpectedError:
              summary: Unexpected API error
              value:
                errors:
                  - code: '10007'
                    title: Unexpected error
                    detail: An unexpected error occured.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````