# Batch Status

GET https://api.apexverify.com/v1/batch/{batch_uuid}

Retrieve the current status of the batch. Once available, the response also includes execution costs, results, and refund information.

Reference: https://documentation.apexverify.com/api-reference/apex-verify-api/batch/status-v-1-batch-batch-uuid-get

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /v1/batch/{batch_uuid}:
    get:
      operationId: status-v-1-batch-batch-uuid-get
      summary: Batch Status
      description: >-
        Retrieve the current status of the batch. Once available, the response
        also includes execution costs, results, and refund information.
      tags:
        - subpackage_batch
      parameters:
        - name: batch_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Batch_status_v1_batch__batch_uuid__get_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
servers:
  - url: https://api.apexverify.com
components:
  schemas:
    BatchSetupVerificationParsingEmail:
      type: object
      properties:
        valid_email:
          type: integer
          default: 0
        wrong_email:
          type: integer
          default: 0
        duplicate_email:
          type: integer
          default: 0
      title: BatchSetupVerificationParsingEmail
    BatchSetupVerificationParsingPhone:
      type: object
      properties:
        valid_phone:
          type: integer
          default: 0
        wrong_phone:
          type: integer
          default: 0
        duplicate_phone:
          type: integer
          default: 0
      title: BatchSetupVerificationParsingPhone
    V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingReadyForVerificationFoundContent:
      oneOf:
        - $ref: '#/components/schemas/BatchSetupVerificationParsingEmail'
        - $ref: '#/components/schemas/BatchSetupVerificationParsingPhone'
      title: >-
        V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingReadyForVerificationFoundContent
    BatchSetupVerificationCostEmail:
      type: object
      properties:
        total_email_cost:
          type: integer
        net_email_cost:
          type: number
          format: double
        email_cache_account_return:
          type: integer
        email_cache_global_return:
          type: integer
      required:
        - total_email_cost
        - net_email_cost
        - email_cache_account_return
        - email_cache_global_return
      title: BatchSetupVerificationCostEmail
    BatchSetupVerificationCostPhone:
      type: object
      properties:
        total_phone_cost:
          type: integer
        net_phone_cost:
          type: number
          format: double
        phone_cache_account_return:
          type: integer
        phone_cache_global_return:
          type: integer
      required:
        - total_phone_cost
        - net_phone_cost
        - phone_cache_account_return
        - phone_cache_global_return
      title: BatchSetupVerificationCostPhone
    V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingReadyForVerificationFoundCost:
      oneOf:
        - $ref: '#/components/schemas/BatchSetupVerificationCostEmail'
        - $ref: '#/components/schemas/BatchSetupVerificationCostPhone'
      title: >-
        V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingReadyForVerificationFoundCost
    V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationOngoingFoundContent:
      oneOf:
        - $ref: '#/components/schemas/BatchSetupVerificationParsingEmail'
        - $ref: '#/components/schemas/BatchSetupVerificationParsingPhone'
      title: >-
        V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationOngoingFoundContent
    V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationOngoingFoundCost:
      oneOf:
        - $ref: '#/components/schemas/BatchSetupVerificationCostEmail'
        - $ref: '#/components/schemas/BatchSetupVerificationCostPhone'
      title: >-
        V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationOngoingFoundCost
    V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationDoneFoundContent:
      oneOf:
        - $ref: '#/components/schemas/BatchSetupVerificationParsingEmail'
        - $ref: '#/components/schemas/BatchSetupVerificationParsingPhone'
      title: >-
        V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationDoneFoundContent
    V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationDoneFoundCost:
      oneOf:
        - $ref: '#/components/schemas/BatchSetupVerificationCostEmail'
        - $ref: '#/components/schemas/BatchSetupVerificationCostPhone'
      title: >-
        V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationDoneFoundCost
    VerificationStats:
      type: object
      properties:
        total_verification:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_valid:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_wrong:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_unknown:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_duplicate:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_account_cache:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_global_cache:
          type:
            - integer
            - 'null'
          default: 0
        total_verification_valid_perc:
          type:
            - number
            - 'null'
          format: double
          default: 0
        total_verification_wrong_perc:
          type:
            - number
            - 'null'
          format: double
          default: 0
        total_verification_unknown_perc:
          type:
            - number
            - 'null'
          format: double
          default: 0
        total_verification_account_cache_perc:
          type:
            - number
            - 'null'
          format: double
          default: 0
        total_verification_global_cache_perc:
          type:
            - number
            - 'null'
          format: double
          default: 0
      title: VerificationStats
    Batch_status_v1_batch__batch_uuid__get_Response_200:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - parsing_content
              description: 'Discriminator value: parsing_content'
          required:
            - status
          description: parsing_content variant
        - type: object
          properties:
            status:
              type: string
              enum:
                - ready_for_verification
              description: 'Discriminator value: ready_for_verification'
            found_content:
              $ref: >-
                #/components/schemas/V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingReadyForVerificationFoundContent
            found_cost:
              $ref: >-
                #/components/schemas/V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingReadyForVerificationFoundCost
          required:
            - status
            - found_content
            - found_cost
          description: ready_for_verification variant
        - type: object
          properties:
            status:
              type: string
              enum:
                - verification_ongoing
              description: 'Discriminator value: verification_ongoing'
            found_content:
              $ref: >-
                #/components/schemas/V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationOngoingFoundContent
            found_cost:
              $ref: >-
                #/components/schemas/V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationOngoingFoundCost
          required:
            - status
            - found_content
            - found_cost
          description: verification_ongoing variant
        - type: object
          properties:
            status:
              type: string
              enum:
                - verification_done
              description: 'Discriminator value: verification_done'
            found_content:
              $ref: >-
                #/components/schemas/V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationDoneFoundContent
            found_cost:
              $ref: >-
                #/components/schemas/V1BatchBatchUuidGetResponsesContentApplicationJsonSchemaDiscriminatorMappingVerificationDoneFoundCost
            stats:
              $ref: '#/components/schemas/VerificationStats'
          required:
            - status
            - found_content
            - found_cost
            - stats
          description: verification_done variant
        - type: object
          properties:
            status:
              type: string
              enum:
                - internal_error
              description: 'Discriminator value: internal_error'
            message:
              type: string
          required:
            - status
            - message
          description: internal_error variant
      discriminator:
        propertyName: status
      title: Batch_status_v1_batch__batch_uuid__get_Response_200
    BadRequestResponse:
      type: object
      properties:
        message:
          type: string
          default: Bad Request
      title: BadRequestResponse
    UnauthorizedResponse:
      type: object
      properties:
        message:
          type: string
          default: Unauthorized
      title: UnauthorizedResponse
    ForbiddenResponse:
      type: object
      properties:
        message:
          type: string
          default: Forbidden
      title: ForbiddenResponse
    NotFoundResponse:
      type: object
      properties:
        message:
          type: string
          default: Not Found
      title: NotFoundResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
    TooManyRequestsResponse:
      type: object
      properties:
        message:
          type: string
          default: Too Many Requests
      title: TooManyRequestsResponse
    InternalServerErrorResponse:
      type: object
      properties:
        message:
          type: string
          default: >-
            Internal Server Error. Please contact support at
            contact@apexverify.com...
      title: InternalServerErrorResponse
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

```

## SDK Code Examples

```python
import requests

url = "https://api.apexverify.com/v1/batch/batch_uuid"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.apexverify.com/v1/batch/batch_uuid';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.apexverify.com/v1/batch/batch_uuid"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.apexverify.com/v1/batch/batch_uuid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.apexverify.com/v1/batch/batch_uuid")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.apexverify.com/v1/batch/batch_uuid', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.apexverify.com/v1/batch/batch_uuid");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.apexverify.com/v1/batch/batch_uuid")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```